The last couple weeks, tweaking my shadow system and adding new features to it kept me from working on my tank game, but instead of working on the shadow system today I decided to try to finish up something on my tank game which was half done.
What I've just added is a tag system and a way to edit the tags in my level editor.
Tags are like generic bits of data. Place an object somewhere in the level, point it in a certain direction, and give it an id number, and you have a basic tag.
If you have an ID of 1, the game might interpret that to be a spawn location, and the orientation of the tag to be the direction which a player faces when they spawn there.
And ID of 2 might be something else entirely.
An ID alone though is no fun. So tags have additional slots for integer, float, and string data. Which of these slots a particular tag ID uses does not matter to the tag system. The game interprets the data. The tag system merely provides a way to make tags for a level visible or invisible, change their position and orientation, and save, and load them.
This is in many ways a better way of doing things than having a bunch of specific types deicated to a spefici type of level object. Instead of having one type for teleporters, one for player spawns, one for a nin interactive decorative item, an invisible one to define a path, you just have the generalized tag which can be anything. This makes creating the tag editor a lot simpler, and allows you to add a new tag without modifying any code other than the game systems which interpret what each tag does. And you can use the same functions to operate on all tags, so you can positon or rotate any one of them with a single function.
So that's what I've just gotten done. This means that with just a little bit more code I'll finally be able to choose and transmit real spawn locations to the other players in a network game instead of spawning everyone at the same point, and I'm not that far off from having weapon spawn locations.
What I've just added is a tag system and a way to edit the tags in my level editor.
Tags are like generic bits of data. Place an object somewhere in the level, point it in a certain direction, and give it an id number, and you have a basic tag.
If you have an ID of 1, the game might interpret that to be a spawn location, and the orientation of the tag to be the direction which a player faces when they spawn there.
And ID of 2 might be something else entirely.
An ID alone though is no fun. So tags have additional slots for integer, float, and string data. Which of these slots a particular tag ID uses does not matter to the tag system. The game interprets the data. The tag system merely provides a way to make tags for a level visible or invisible, change their position and orientation, and save, and load them.
This is in many ways a better way of doing things than having a bunch of specific types deicated to a spefici type of level object. Instead of having one type for teleporters, one for player spawns, one for a nin interactive decorative item, an invisible one to define a path, you just have the generalized tag which can be anything. This makes creating the tag editor a lot simpler, and allows you to add a new tag without modifying any code other than the game systems which interpret what each tag does. And you can use the same functions to operate on all tags, so you can positon or rotate any one of them with a single function.
So that's what I've just gotten done. This means that with just a little bit more code I'll finally be able to choose and transmit real spawn locations to the other players in a network game instead of spawning everyone at the same point, and I'm not that far off from having weapon spawn locations.