Improving AI Performance
So what's a Dictionary Pool, you may ask! Well, at its simplest (which this is), it's a big list of pre-made Dictionaries, each with a flag on to indicate if it's being used. When we want a Dictionary, we grab one from the pool, put it in a list of 'in-use' Dictionaries, and mark it as being used. When the object using it is destroyed, we mark it as free, and put it back in the pool for someone else to use. The key here is to be very strict on who is using your object! It's critical that nobody is using it when it's marked as free, or the whole concept breaks down.
And immutable states? Immutability is another weird software-engineer-y word. In english, it means something that never changes. But that's perhaps misleading when it comes to thinking about objects in Unity - what use is an object you cannot alter? The answer is that while you can't change the object, you can create a new one to reflect this change. This means you have precisely one instance of any particular combination of object. For us, this means that instead of creating hundreds of thousands (no exaggeration) of states, all duplicates of one another, we create... about seventy. The overhead of querying a Dictionary for the instance of the state we want is much, much less than creating a tiny object, then destroying it, repeatedly.
These two changes weren't trivial, as such, but were fairly self contained, and only produced a handful of super frustrating bugs that I had to then work against for a week or two.
Back within 60fps, but still a lot of garbage to deal with! But the good news is that performance improved drastically! We are now back to 60fps within the editor on my machine, mostly. Which was a relief because I feared for a moment or two that I'd accidentally extended the AI system in such a way that it would never be useful in a finished game, which would have been embarrassing. -Steve If you havent already - be sure to wishlist and follow OFF GRID! Each wishlist makes a big difference to us, and we really appreciate your support!
[ 2018-12-11 17:35:06 CET ] [ Original post ]
Hi all, Steve here! There's been some monstrous performance spikes in our AI, and I've spent time over the last month working to mitigate this issue. Two significant changes have been made to improve this: 1 - the addition of a pool of Dictionaries to store states, and 2 - making each state item immutable This vastly reduces object creation, which is slow, and reduces the number of objects in existence, which helps reduce memory fragmentation (another Bad Thing) - which, being C#, is harder to control than in C++.
DICTIONARY POOL
So what's a Dictionary Pool, you may ask! Well, at its simplest (which this is), it's a big list of pre-made Dictionaries, each with a flag on to indicate if it's being used. When we want a Dictionary, we grab one from the pool, put it in a list of 'in-use' Dictionaries, and mark it as being used. When the object using it is destroyed, we mark it as free, and put it back in the pool for someone else to use. The key here is to be very strict on who is using your object! It's critical that nobody is using it when it's marked as free, or the whole concept breaks down.
IMMUTABILITY
And immutable states? Immutability is another weird software-engineer-y word. In english, it means something that never changes. But that's perhaps misleading when it comes to thinking about objects in Unity - what use is an object you cannot alter? The answer is that while you can't change the object, you can create a new one to reflect this change. This means you have precisely one instance of any particular combination of object. For us, this means that instead of creating hundreds of thousands (no exaggeration) of states, all duplicates of one another, we create... about seventy. The overhead of querying a Dictionary for the instance of the state we want is much, much less than creating a tiny object, then destroying it, repeatedly.
These two changes weren't trivial, as such, but were fairly self contained, and only produced a handful of super frustrating bugs that I had to then work against for a week or two.
Back within 60fps, but still a lot of garbage to deal with! But the good news is that performance improved drastically! We are now back to 60fps within the editor on my machine, mostly. Which was a relief because I feared for a moment or two that I'd accidentally extended the AI system in such a way that it would never be useful in a finished game, which would have been embarrassing. -Steve If you havent already - be sure to wishlist and follow OFF GRID! Each wishlist makes a big difference to us, and we really appreciate your support!
Off Grid
Semaeopus
Semaeopus
Coming soon
Indie Strategy Adventure Simulation Singleplayer
Game News Posts 74
🎹🖱️Keyboard + Mouse
🎮 Full Controller Support
No user reviews
(0 reviews)
http://offgridthegame.com/
https://store.steampowered.com/app/526720 
The Game includes VR Support
Off Grid is a 3rd person stealth hacking game where data is your most powerful weapon. Off Grid forgoes combat for hacking tools and ingenuity, and is completely moddable.
Gameplay utilises unique mechanics that allow you to manipulate the world and people around you with the data they unwittingly leave behind. It’s a stealth game where the player can truly hack and manipulate objects in the environment.
Players, modders, and hackers will be able to use the game to create new and interesting levels with stories about surveillance, hacking and the internet of things.
Gameplay utilises unique mechanics that allow you to manipulate the world and people around you with the data they unwittingly leave behind. It’s a stealth game where the player can truly hack and manipulate objects in the environment.
Players, modders, and hackers will be able to use the game to create new and interesting levels with stories about surveillance, hacking and the internet of things.
Features:
- Stealth and hacking gameplay based on use of data and environments rather than weapons and combat
- Hack into lifelike simulated networks and data with realistic hacking techniques and tools including SSH, sidejacking, and social engineering of the AI
- Contemporary storyline and missions related to real-world events surrounding data privacy and mass surveillance
- Fully moddable content encouraging players to create new and interesting levels, whether complete fantasy or mimicking hacking in the real world around them
- Outstanding audio and original soundtrack from Jonas Jensen and Lyndon Holland, the BAFTA-winning composer from the game Virginia
MINIMAL SETUP
- OS: Ubuntu 16.4 or equivalent
- Processor: Intel Core i5 2300 or AMD FX6120Memory: 6 GB RAM
- Memory: 6 GB RAM
- Graphics: GeForce GTX 550 Ti or Radeon HD 6770
- Storage: 10 GB available space
- OS: RISC architecture is gonna change everything
- Processor: P6 chip. Triple the speed of the Pentium
- Graphics: 3Dfx Voodoo capable GFX cardSound Card: The Sound Blaster 1.0 ( "Killer Kard")Additional Notes: 28.8 KBPS Modem
GAMEBILLET
[ 5951 ]
GAMERSGATE
[ 3198 ]
FANATICAL BUNDLES
HUMBLE BUNDLES
by buying games/dlcs from affiliate links you are supporting tuxDB