Fishguts I : Adding LOS/FOV
When I dropped my FOV code into fishguts I was taking a lot of things for granted. A lot of the easy wins that the roguelike gave me are things I have shunned in fishguts (a lot of memory overhead) and some of the compromises I have made. Segmenting my maps is whats causing the biggest headache right now. I still think it was worth doing that way, I just have to reorient some of my thinking to fit it in in a way I haven’t been doing in the past.
The biggest headache is that player co-ordinates don’t directly map into the segments and the segments are centered around the player, so all references have to pass the player in because the game knows the player is the center of the universe.
Because the map ‘wraps’, the spot to the right of the player could be the other side of the map which throws the co-ordinates right out the window.
I’ve had this post open in my editor for most of the day. Ive got LOS working but its been a bear, far more so than it should have been. It should have been relatively simple to add. Maybe I went too much in one direction. Segmental map loads are great if I wanted an infinite sized map… but maybe not so worth it for the lack of LOS.
Hmm with a few hours more since the last paragraph, its actually working very nicely to my surprise, some tweaks have also speeded up the map drawing.. refactoring a little code here and there has paid off.
All my memory usage stats are out the window, since the SDL framebuffer was being included, so when running a GP2X sized window I’m actually only pulling 150kb, so sans 75kb for a 320x240 framebuffer, I’m really only using 75kb! Thats bloody sweet.
With that kind of memory usage, I could disregard segmented maps, reduce code size (not by much), reduce complexity.. geeze. Im not trying to fit the game on an Apple IIgs!
I gotta reconsider my segmented map strategy… I’ve whined enough about their pain, I just need to decide once and for all if I will do anything about it and say no more if I dont.
Hacked in som TVOut support even tho I dont have a TV out cable yet.. once the game is 99% done I’ll spring for one then…
Its looking good!
Filed Under : Computers • Development • Fishguts •
Comments are closed There are no comments on this entry.