Jump to content

Level Management: A Bucket 'O' Walls

Road Kill Kenny

1,301 views

Setting up how a level works can sometimes be a tricky task, especially when the a games level appearance is more abstract than say a first person shooter where everything is as you would see it in real life.

 

My game is one example of these abstract level appearances. It Predominantly takes on a semi-top down dungeon style view where the roof of the level is missing so that the player can see inside the level.

 

The below video blog shows how I resolved a few issues that are inherent from this style. This is still a work in progress. However, I thought I would share my technique.

 

 

In the near future (once I have a bit more gameplay) I intend to improve this technique by making the walls fade in and out instead of abruptly being shown and hidden. This presents some challenges because, if I use a shader to do it, what will happen is that shader will affect all the walls when I set a fade because the shader will be attached to the wall material. I have a few workarounds in mind. However, I'll leave that for another time.

 

Thanks for reading and watching. I hope to show a bit more than the one room soon.



12 Comments


Recommended Comments

Thanks Ken that was a nice walk-through.

 

I remember first time I saw fading walls in Die Hard, a shooting game on the old Playstation which had 3 game types bludgeoned together. One of them was 3rd person.

 

It's possible without too much effort to do fading walls at the shader level but I like your approach as it has character and fits with the lovely retro music you've got going on. You could even combine the two.

 

But if anyone wanted to play with a shader to do it, off the top of my head...

 

The rotation angle of the model subtracted from the camera angle in the vertex shader will give you the parameter needed to determine how much the wall can be faded. This is passed to the frag shader which blends the rgba output accordingly.

 

Alternatively use the vert colour to set the alpha (and set the colour of the model in a LUA script based on it's rotation). Kind of messy but affords a level of control (since you can set keys to start/stop the fade).

 

Just some thoughts. The level manager looks great too. It will reap rewards in terms of control over performance. That's something you can't do with large levels containing big models. I've heard people say GPUs are more efficient than culling routines but in the real world it doesn't work out like that.

 

Good work, I wish I had half the energy you have :)

Share this comment


Link to comment

Thanks guys. Glad you liked it.

 

@Flexman: Hehe yeh. I am considering looking into shaders for it later. But that is a lowish priority I think. Also I'm not too sure if I will adopt that method or not anyway. As you say the retro music XD.. One of my idea's is to make a game that is not so serious.... like games used to be. Not everything has to be realistic all the time in every game (tho there are times when it's good).

 

I sorta want to make a game that is..... proud to be different. break the rules.... have old school retro music and not give a damn.... A game that doesn't give a damn if it's too hard for some people or doesn't care if it's too easy for some elitists. This game is designed to be proud to be a game and doesn't pretend to be something else. A game that doesn't apologise for its rough edges.

 

Not that there is anything wrong with games that try to be realistic at all... this game is just different. BTW when is Combat Helo coming out? Been wanting to play that since I discovered Leadwerks. I used to play tonnes of heli sims when I was a kid... never seen anything like combat helo tho.

 

A Note On Performance:

My idea of the level manager came from a thought on scalability. Basically the minimum number of rooms that must be rendered is 3. However, it is preferable for more of the level to be visible at once... WIth this system my options are open. If I put this on Android and IOS I can reduce the number of rooms rendered at any one time. I could even make an options setting that allows the player to set the max number to show... Therefore, if someone has a **** computer they can set it to 3 so only shows 3 rooms... 1 for each robot assuming they may be in different rooms at any one time.(oops did I just give something away).

 

However, if someone has a super computer they could set maxRooms to 100 and see everything. Therefore anyone will be able to play it. Provided they have the minimum Leadwerks specs

Share this comment


Link to comment

We had that in the forum some time ago but with self-contained lua objects ... the dummy object would just load its sub-parts like you do too :

 

   --Load all the parts for the models
   --
   object.mezzHouse_parts01_groof =LoadModel("abstract::gTown_smallBlock_mezzHouse_parts01_groof.gmf")
   object.mezzHouse_parts01_gfloor=LoadModel("abstract::gTown_smallBlock_mezzHouse_parts01_gfloor.gmf")

object.mezzHouse_parts01_gwalls_1=LoadModel("abstract::gTown_smallBlock_mezzHouse_parts01_gwalls_1.gmf")
   object.mezzHouse_parts01_gwalls_2=LoadModel("abstract::gTown_smallBlock_mezzHouse_parts01_gwalls_2.gmf")

 

but since all loaded models can have its own lua script we made a simple camera-distance check to repaint the part in question with a transparent material like :

 

 if fw~=nil then
  object.model:Hide()
--    pick1 = LinePick(campos, camera.position, 1, nil)
  pick2 = CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2, 20.0),0,0)
  object.model:Show()
--    if pick1~=nil then SetWorld(fw.main.world) end
  if pick2~=nil then
   SetWorld(fw.transparency.world)
 object.model:Paint(LoadMaterial("abstract::dirtyglass2.mat"), 1)
   SetWorld(fw.main.world)
  else
--	  [fixme] rePaint original material ...
--	  and scale materials alpha value by distance (glFragData.w)
   object.model:Paint(LoadMaterial("abstract::gTown_1_1024.mat"), 1)
  end
 end

 

... the issue which came up was that lights and skinned models are occlussion culled by default and "cant" deal with this way of half-transparency. A real shader for this might work however if you push the object in question into the transparent world.

Share this comment


Link to comment

PS : you cant copy "thesecretworld" wink.png ... its a crossover of left4dead and Nocturne, just like 80% of all the new horror/action games.

 

[edit] :

just kidding about review with "theSecretWorld" in your "LE Community Project, Inspiration" video.

Share this comment


Link to comment

PS : you cant copy "thesecretworld" wink.png ... its a crossover of left4dead and Nocturne, just like 80% of all the new horror/action games.

 

Why comment on a different video I made on youtube here? Besides that was for LECP and it had nothing to do with copying the game itself.... and tbh there is nothing left4dead about thesecretworld at all if you've actually played it....

Share this comment


Link to comment

Home Wars?

 

Nope.. that's not the name ;)

 

I came up with some idea for a real simple game called Home Wars where you are little bathroom sign people running around a house killing each other with whatever you could find. But before I got to actually any game defining thing it became something else.. However, the project name is still called Home Wars lol.

Share this comment


Link to comment

Ah, domestic violence game would go down great with my kids here. They have to settle for blowing each other up in Minecraft. Oh the howls of laughter and joy.

 

@Ken, as for CombatHelo, I return to that in September when I've got my book out of the way. As for realism, I can take it or leave it, depends entirely on the game and what it's trying to do.There'a Air Traffic control sims and there's those little air-plane lander games that you swipe with your finger.

 

The occlusion issue I totally forgot about, "layers" in other engines you're not supposed to name get around this. Your method should work fine in this respect.

 

Macklebee had a kind of x-ray shader thing going on.

Share this comment


Link to comment

Came to this late, but well worth watching. I like the way you tackle issues head on and find solutions. At your young age I suspect you have a great future in the games industry be it your own company eventually or working for an existing one!

 

Always makes me smile when I see others writing the same functions I have

previously. We all reinvent the wheel but it's the best experience we can get. Having code handed to us teaches us little, even if it sometimes saves time in the short term.

Share this comment


Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...