• entries
743
1924
• views
580416

# Graphics working

385 views

Got graphics working properly now. Just using some place-holder stuff I drew a few years ago for some daft RTS I was working on.

Decided to go with the slightly-Y-offset approach a la old school RPGs. When rendering, I have the map grid and also a bucket grid of vectors of IDs of characters. Before I render, each character places itself in the bucket on the basis of the following:

void Creature::AddToBucket(BucketGrid &Grid){ int X=Pos.X/48; int Y=Pos.Y/48; if(Offset.X>0) ++X; if(Offset.Y>0) ++Y; Grid(X,Y).push_back(Id);}

Then when rendering each map cell, after rendering the cell I render every character whose ID is in the bucket for that cell. Seems to work okay.

There is now a list of creatures on the map and you can select any who are on the player's side and move them around using the path-finding mechanism. Enemy players block routes but not line of sight and you can click on an enemy to walk to the closest adjacent square.

Currently trying to scheme some way to improve the fog of war effect using shaders but no real clear plans on that at the moment.

Load of old bollocks really. Now going to play Splinter Cell: Chaos Theory for a bit. Just been speaking to my phone provider and begging them not to cut me off for non-payment of bills and they were quite helpful really. In the process of getting a debt relief order sorted to clear the GBP3k+ that I owe but at least making positive steps forward. Can't lose the phone number though.

There are no comments to display.

## Create an account

Register a new account