I have also made a level class to deal with multiple levels so there will soon be many more levels, each increasing in difficulty. Anyway here is the game as it stands:
Peace out :)
Over the past few days I've worked on implementing some better gameplay as it simply wasn't challenging enough. I've managed to implement some objects that have to be avoided otherwise you lose a life and respawn at the last checkpoint. The objects are supposed to be tumbleweed, which was actually my mothers idea. I have got Cube placeholders at the moment as I haven't managed to get any models created yet. I have also made a level class to deal with multiple levels so there will soon be many more levels, each increasing in difficulty. Anyway here is the game as it stands: Okay, so I am now in desperate need of some new models and sounds and I will be getting that done fairly shortly. I will also be implementing many new levels. This will mean I will have to adapt the highscores table to take level and lives into account. Although this project has been really fun I am starting to feel like this project is coming to a close. I think within then next few weeks I will finish this game off and begin a new project, or try implementing the full matrix instancing again.
Peace out :)
0 Comments
Whilst I was away in Ireland I worked on my Road to Eldorado mini game. The first thing I changed was allowing the Instancing to work with any of the render methods as before it was only working for one. This caused errors for example the gems were actually only supposed to be one colour but as it was using the render method that needed a texture ,then it used whichever texture that was on the model that was rendered just before it. So for example the cactus texture was being used on the gems which was completely wrong. After doing this I started adding features to the game such as a speed multiplier that changed the speed of the car and the speed of movement from side to side. This was altered by the use of checkpoints throughout the level. Every time the player passed a checkpoint then the speed would be increased. This made the game much more appealing and also slightly challenging. Anyway here is the video: I also started work on a high scores system which would be used at the end of the level to insert your own name and this would be exported to a text file. The text input part is working and the name and score are exported but there is still work to do on this.
The next main part is to parse the file calculating the scores and then inserting the new score at the right point. I also need to output the high scores table to the screen. It does seem that by adding a high scores system I am edging closer and closer to having to create a proper front end :) I am over in Ireland at the moment visiting my father but just before I went away I managed to get a couple of things done. The first thing I attempted was the use of full matrices for the Instancing which has not been going so well. I worked on Implementing this and increased what data needed to be passed across and the size of the input layout and what not but came out with some rather peculiar results. The models where stretched across the screen and some just did not appear at all. At this point I ran the project using PIX to check the data that had been passed across and this is what it came out with: As you can see the outcome after the vertex shader is completely wrong. After checking the values in the instance buffer I can see that only the first values are correct, which are the positions. The X,Y and Z axis are completely random values which is the reason that the results are so strange. I will need to have a further in depth look at the reasons behind all this but I'm presuming the byte width of the instance data is being calculated wrong at some point, however this is only a guess. Terrain Analysis InstancingI took a break from trying to implement the matrices geometry instancing and decided to add the current position only instancing to the Terrain Analysis Tool of my third year project. This tool only needed the positions as it only had sphere models which do not need rotation and the scale is the same for all. The integration of this took no time at all as I had implemented the instancing in a way that would simply mean adding a "Instancing=true" value to the templates of the XML document and replacing the "RenderAllEntities" function with the "RenderAllEntitiesInstanced" function. Once I had replaced all the files that were needed I created a quick video to show the terrain analysis with the Instancing, which is shown below. The frame rate on the new project has increased massively. On this map the original frame rate was around 30 FPS when all nodes were in view and with the geometry instancing I am now reaching up to 250 FPS although you cannot really see this as Fraps slows down the program quite considerably.
There are lots of improvements still to be made to the project such as adding more features to the tool allowing for nodes and game zones to be specified as water nodes. More than likely I might add a feature to specify my own types of data that can be assigned on the fly. This would allow so much flexibility to the tool and allow it be used in many more situations and genres. Well that's all for now, I will be continuing work on my projects such as the Road to Eldorado game and implementing the full matrices instancing, although I will also be looking for jobs in the mean time as well. Peace. After tediously working away getting this instancing working I decided to take a step back and see what I can actually create using instancing. After seeing what low-poly models I could get my hands on I decided to go for a desert theme with some sort of car/spaceship and so I present to you "The Road to Eldorado": Okay so it's only a simple game but creating it was quite fun and it really showed me how easy it is going to be to create attractive, detailed environments for my future games or demo's. I'm still going to be carrying out some extra work on this mini-game; adding more features but mainly tweaking the instancing to include non-updated instancing, which essentially means removing instances from the entity list as they are only used on creation and deletion.
I still need to attempt the instancing with rotation and scale but at the moment I'm too interested in playing around with this little mini-game. After a tough couple days working on this I finally managed to get it working. The main reason for the set back is that I was trying to do too much too fast; never a good idea. I was trying to both integrate the instancing with the entity manager and other aspects of the code to ensure it performs with little interaction, whilst at the same time trying to increase the demo to support full matrices rather than just positions. After a frustrating few hours debugging code I made a decision to step back a version and try to just implement the integration aspect and use only positions for the models. Once I had made this decision the code simply fell into place, there was one small hiccup with the pass description but apart from that it all managed to go smoothly. Below is a video of the Instancing which now works using XML to specify which meshes will be instanced. This means that creating large scale environments with many simple models will be a breeze. As always I'm still not happy with this outcome as there is much more needed to be done. Firstly there is the whole aspect of using the full matrices so that I can use rotation and scale on the models being instanced. This will be much easier now as I'm working with fully working code. There has been a massive performance drop from when I was doing the simple Instancing. This is due to the fact that because the Entity Manager is involved and these models are now entities in the scene the Entity Manager not only has 20,000 more models to iterate through but it also has that many entities to update. There are various ways I may go with this:
1. have a separate list for instanced entities that don't need updating or iterating through. 2. put up with it and accept that 20,000 models is a reasonable amount and still be able to have update functions for these instances. I'm still undecided on which I will stick with, or I may even do both and use the appropriate one for the situation i.e. if there are lots of stationery objects such as plants, trees, shrubs then use the non-update version and then other for when entity interaction is necessary. Anyway back to work :) Over the past week or so I have done little development as I've been roped into various chores such as stripping, sanding and decorating a hallway. When I've had a minute I've managed to do a little progress on my instancing demo.
Now that I have got the instancing fully working with movement as well there are a few further improvements to be made before it can really be called a success. First of all I have started implementing the instancing to work on placed models within the scene, by collecting the instance information each frame and then passing that to the Instance Buffer. Currently the instancing works by using one model from the scene and using made up position offsets to draw them all. This is impractical and currently only works for one model. There have been some issues with implementing the new approach, first of all I have had problems passing all the information across to the instance buffer and I believe this will mostly be due to the varying size of the instance buffer from frame to frame. I will more than likely have to check to ensure that the instance data is still the same size or re-create a new instance buffer. Once this issue is sorted I should have any model that has been specified as instance-able automatically instancing. The problem with this is that it is only position data that is being passed across to the vertex buffer. I am trying to expand this to include rotation but I am reluctant to send too much data across. The most I can degrade a matrices down to is something like 9 values using cross products to calculate one of the axis on the GPU. Anyway I'm hoping to have the major issues out soon so I can post a video, I have also been fiddling around with 3DS Max to try and create some slightly better models. I think a landscape with many small bushes like skyrim would create a rather nice video but we shall see. Keep it Easy. Now in the image you can see the instancing being performed to create 7,000 models in one draw call. There does seem to be some rather large performance issues with this. For tonight this will do as it's much easier to optimise something that works. Extremely relieved to finally get this working.
Take it easy. Today I have started trying to do geometry instancing to considerably reduce the number of draw calls needed when drawing lots of the same model.
So far the development has not been going well at all, I have Initialised all the vertex buffers that are going to be used and adjusted the Vertex Layout Description to accommodate for the extra per instance input element "POSITION". I have also set both buffers to the IA stage along with the correct technique and for some reason there is absolutely nothing being rendered at all. I am going to be looking further into the problem to try and find out exactly where I am going wrong. |
Archives
May 2020
Categories
All
|