May. 16th, 2021

Work Post

May. 16th, 2021 06:33 pm
relee: Picture of Relee Starbreeze, Wizard (Default)
6:34pm - Well I've spent quite a bit of spare time the last few days trying to figure out a bit more of how the GoRogue library works 'under the hood' and I think I've figured out the key difference to it, as well as figuring out that it can actually modify terrain mid-game.

The key difference from what I've been doing and what GoRogue does is that I was keeping a list of entities like actors and items, while GoRogue uses something called a SpatialList.

7:05pm - Bleh. Got bigtime distracted in the middle of what I was writing.

So, a SpatialList is primarily based on two dictionaries, called _itemMapping and _positionMapping. _itemMapping is a dictionary where the item is the key, and the position of that item is the data. _positionMapping is a dictionary where the position is the key, and the item, or a list of items (depending on the type of spatialmap) is the data. So, you can find out what's at a location using the _positionMapping, or you can find out where an item is using the _itemMapping.

This seems like a good method to track the location of objects in the world, compared to a flat list.

Anyways I just wanted to get that recorded somewhere. I don't think I feel like working more tonight.

Profile

relee: Picture of Relee Starbreeze, Wizard (Default)
Relee Squirrel

July 2023

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 24th, 2025 10:57 am
Powered by Dreamwidth Studios