SQL ERROR

Suggestion

This is a suggestion for one of our games. You may comment on and rate the suggestion here.

The Suggestion...

By: on 14 Feb 2010
Rating: 0.00 in 0 votes
Status: rate | *In Roadmap*
mr4 | map | [Suggestion_6421]

Sectionalised minimap

I've been playing around with the map maker a bit, trying to make an absolutely huge map (15 by 15 square) and it seems like the minimap is looking for too much info, and is lagging a bunch in appearing and moving between screens (although this may be due to trying to search for the next room to enter). Also, it takes up a substantial part of the screen when the map is that size. I'm thinking that having the minimap only show part of the map (that surrounds you) would help a bunch. Of course, that also might just make it slower... I don't really know how the map is set up.
Roadmapped by (done)



Comments

15 Feb 2010 [comment_27707]
NEW! steve
I think the mini map queries every square of the map, asks each one if they contain enemies, friends or what, then decides what colour that square should be.

I think it does this every time you move rooms. If so, it should be relatively easy to optimise it so that it only updates the room you were just in, and leaves everything else the same. Any takers?

You can also make the minimap smaller (this won't make it faster though). In your map file find the bit that says

 
#roomMapScale: 0.0625,


And change it for a smaller number - try halving it.

 
#roomMapScale: 0.03125,


If that's not small enough, halve it again.


16 Feb 2010 [comment_27720]
NEW! megaman4ever
This made me remember I should copy my old unfinished maps over to my new better-than-old-laptop-with-no-win98-shit and do them with MRopen


17 Feb 2010 [comment_27724]
NEW!
I think this might be next on my list of things to do :)
Working out the kinks with the builder units is a little bit beyond me I think.


18 Feb 2010 [comment_27745]
NEW!
Done! And rather speeds things up!


18 Feb 2010 [comment_27746]
NEW! steve
Awesome work dude. I'm looking forward to checking this out tomorrow


19 Feb 2010 [comment_27756]
NEW!
Unfortunately I did that right after sending you it :(

but... here's the function to replace ;)
Its a little wordy, I could probably put some time into slimming it down...
Oh! and initialize a property called pMapData to be #none
 
on getMiniMapData me
if pMapData = #none then
pMapData = g.objectMaster.requestObject(#objDataMap)
params = pMapData.getParams(#init)
params.mapSize = me.ID.bigMe.getSize()
pMapData.init(params)

-- loop through all rooms, asking for miniMap status
roomCount = me.getCount()
repeat with i = 1 to roomCount
nRoomNum = me.ID.bigMe.peekEntryNo(i)
nRoom = me.ID.bigMe.getRoom(nRoomNum)
nMiniMapStatus = nRoom.getMiniMapStatus()

pokeLoc = point(0,0)
pMapData.pokeEntryNo(i, nMiniMapStatus, pokeLoc)
end repeat

else

-- check above, below, left and right
repeat with i in [1,-1]
nRoomLoc = me.ID.bigMe.getCurrentRoomLoc()
nRoomLoc.LocH = nRoomLoc.LocH + i
nRoomNum = me.ID.bigMe.getRoomAt(nRoomLoc)
--left and right
case nRoomNum of
#OutsideMap:
nothing
otherwise:
nRoom = me.ID.bigMe.getRoom(nRoomNum)
nMiniMapStatus = nRoom.getMiniMapStatus()
pMapData.poke(nRoomLoc, nMiniMapStatus)
end case
--up and down
nRoomLoc = me.ID.bigMe.getCurrentRoomLoc()
nRoomLoc.LocV = nRoomLoc.LocV + i
nRoomNum = me.ID.bigMe.getRoomAt(nRoomLoc)
case nRoomNum of
#OutsideMap:
nothing
otherwise:
nRoom = me.ID.bigMe.getRoom(nRoomNum)
nMiniMapStatus = nRoom.getMiniMapStatus()
pMapData.poke(nRoomLoc, nMiniMapStatus)
end case

end repeat
end if
-- change current room status to #cur
currentRoomLoc = me.ID.bigMe.getCurrentRoomLoc()
pMapData.poke(currentRoomLoc, #cur)
return pMapData
end



19 Feb 2010 [comment_27761]
NEW! steve
Good stuff! That pretty much worked I just had to add the function getRoomAt to objMap and change #OutsideMap to #errorOutsideMap.

I can't tell how much quicker it is cos I haven't done a really big map yet. but it seems much more efficient at gethering the data.

You might be able to get further improvements by looking at the bit where the map is actually drawn to a bitmap. (Unless it all happens in the same place, I haven't looked into it properly yet).


You must be logged in to add a comment.