Jump to content

xtom's Blog

  • entries
    6
  • comments
    31
  • views
    9,007

Buildings, Doors & Zombies


xtom

4,747 views

 Share

blog-0810899001425484176.jpgSince my last blog update I’ve spent the majority of my game dev time working on my map and in particular the buildings. When I say buildings I mostly mean one in particular which is a house that I’ve been working on for a good while now. The house initially started out as 100% csg but after memory issues in the editor and feedback and advice on the forum I decided to re-do parts of the house as models. This meant I had to use blender more than I would have liked but the good thing is I think I am getting a bit more used to it so I guess the learning experience is good.

 

So now my doors, door frames, windows and light fixtures are all models instead of csg. The advantage with this it seems is that the models are instanced automatically by the leadwerks engine and can be used over and over without increasing memory usage too much. The other advantage is it allows me to set the view range on the different models, something that csg ignores, maybe because it doesn’t need it so much compared to complex models. So for example by setting my ceiling light models to Near they aren’t rendered far away so I am hoping this will help speed up game performance too. I also removed the csg skirting boards along the walls in favour of wall textures with skirting on. The look is just as good but more importantly again it should hopefully provide better performance.

 

In general I’m wrestling a lot with performance as I go because my pc is not high end. Before I renovated the house building a street with 10 of them was giving me about 5fps but I’ve managed to bring this up to about 10fps and I still have some more improvements I can make. Although for every improvement I make I’ll want to also be adding some other stuff in so it might cancel out each other in the long run. Will just have to see how it goes.

 

 

backwindow.jpg

 

The floors and walls in my buildings I have left as csg, the advantage I see with this is I can easily apply different textures to the walls and floors in the different buildings to add variety. And I can easily adjust building layouts in the editor if I need to. If I have to convert these to models for performance then I’ll probably wait for a csg to mdl conversion because it would take me ages to re-texture it in blender.

 

Lights

 

I added workable lights/light switches - This was pretty quick and easy to do thanks to the flowgraph which I used for the first time and switching the lights on for the first time was a happy moment. smile.png I’m not sure about the lights yet I’ll have to see how they effect performance before I decide on which ones to have. Right now they are all in there for now but are hidden.

 

Doors

 

So the next thing to add was doors which turned out much trickier than the lights. I used the default swingingdoor.lua script but their are so many little things to consider that it took a while to get them working right. And then the zombies wanted to walk through them when closed, which took another while to figure out.

 

Zombies

 

During the steam sale I picked up the zombie pack and the fps pack and I’ve been testing them out. I’ve changed the default ai a bit so there are fast and slow zombies in the game and also they can re-animate (as in come back to life) a number of times after you kill them. So watch your back when you kill one smile.png You can run into buildings and close the doors to try and evade them but be careful as they can sometimes muddle doors open, so again watch your back smile.png

 

I’m having a blast at the moment now that there is some actual gameplay and managed to scare myself a few times so that’s a good sign. smile.png

 

I’ll probably do a dev log video soon but for now I will finish this blog post with some screenshots of a test zombie horde. This actually had very little impact on my frame rate which I was happy to see. smile.png

 

 

zombie-horde-1.jpg

zombie-horde-2.jpg

zombie-horde-3.jpg

  • Upvote 6
 Share

14 Comments


Recommended Comments

You won't regret investing some time in Blender as you'll be able to go crazy and model anything very fast.

 

It looks good and will look better with vegetation on terrain surroundings.

  • Upvote 1
Link to comment

Yeah with some objects like the doors and windows I exported as obj from leadwerks into blender. It's easier for me this way to test and get the size right and then I can add details if I need to. I think my most complex thing I've modeled so far from scratch in blender is the door handles. I was pretty chuffed with them. :)

 

The map is still very barren at the moment, lots more needs adding but my frame rates are worrying me with what I have already.

Link to comment
but my frame rates are worrying me with what I have already.

Hide distant lights and distant interiors objects and hide interior Zombies just let them navigate but hide them.

 

You have lot of zombies, so lot of scripts running, perhaps when 5 zombies are going around the player, just make the other roam arund with random destination like stupid zombieswihtout calling navigation functions.

 

If you lower zombies maximum number zombies visibles and make them spawn from hidden points , it should work better.

 

Good luck.

Link to comment

The zombies don't seem to be impacting the fps too much, it's more the buildings are still my fps problem. If I remove all zombies I get average 10/12 fps and if I add 20 zombies I still get about the same 10/12fps.

 

I'm already hiding interior building objects by using the view range setting on the models, lots of them are set to near, but I might have to spread out entry buildings with non-entry buildings or something like that to help more. For example if I walk away from the buildings far away around a mountain the fps goes back up.

Link to comment

Looking good.

 

If you cant see interior objects does that still hinder performance? So items you cant see (behind a wall etc) have to have set to near?

Link to comment
For example if I walk away from the buildings far away around a mountain the fps goes back up.

 

The floors and walls in my buildings I have left as csg, the advantage I see with this is I can easily apply different textures to the walls and floors in the different buildings to add variety

This could be the problem.

Try replacing all CGS by some Blender test model building, i think you'll get really better frame rate.

Link to comment

Yeah I'm going to do some frame rate tests later. Really I would like to see csg performing better because it's just collapsed geometry and not even treated like an entity like the way models are. I would have thought it should be faster but it seems no matter what models are faster in every scenario?

Link to comment

Interested in the results of your testing. My current project is getting larger and I want to get the frame rate as high as possible. I remember Josh saying that each model is one entity and each CSG is one entity so for complex structures you are better off to use a models.

Link to comment

Interested in the results of your testing. My current project is getting larger and I want to get the frame rate as high as possible. I remember Josh saying that each model is one entity and each CSG is one entity so for complex structures you are better off to use a models.

That's not correct. CSG brushes get merged into chunks of geometry when the scene is loaded in the engine.

Link to comment

Hi, Josh as implemented CSG exporting to meshes that you could load in Blender as reference and build over them in more details there.

 

It's best to start with CSG first to test your ideas in gameplay and see if it's fun, then export that as reference to make it pretty when you think the design of the house is adequate for your need.

 

That's a good idea that you created the house in parts, since you will be able to exchanges some parts and create variations.

 

You could keep some of the CSG and use them only for collision. (make them invisible and don't put collision on the blender meshes). Perhaps you won't need them after, seen that Josh added Convex Decomposition that should create a optimized collision models from a mesh automatically. (Not tested it yet)

Link to comment

Yes that's pretty much what I've ended up doing - build and test in leadwerks and then export to obj whatever parts might be better as models. I use the convex decomposition on the furniture models and it's very good. But sometimes for example with the picket fence model I just select the box collision.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...