This is a suggestion for one of our games. You may comment on and rate the suggestion here.
The Suggestion...
Roadmapped by ♪ (done)
Comments
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
And change it for a smaller number - try halving it.
If that's not small enough, halve it again.
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.
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
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.
Working out the kinks with the builder units is a little bit beyond me I think.
Done! And rather speeds things up!
Awesome work dude. I'm looking forward to checking this out tomorrow
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
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
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).
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.
Rating: 0.00 in 0 votes
Status: rate | *In Roadmap*
Sectionalised minimap