Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / Dynamic levels in FPSC - an experiment

Author
Message
Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 02:27 Edited at: 19th Feb 2011 12:59
I have spend my evening trying to make a proof-of-concept for FPSC where some parts of levels are removed from the game at run-time. It's a simple trick where I use a triggerzone to place a dynamic entity wall to cover up a doorway.

Why? Well, this could be cool since you can build levels that are random for every play if you generate the entity wall with the RANDOM fpi condition (I also have a basic random system for generating enemies that I made with the help of this thread - look at the post from xplosys dating 2nd Aug 2007 20:27).

However I have a huge problem which can be seen in the attached video. The entity wall has no collision. I have tried every type of collisionmode = X in the FPE file. The only way I can make the wall dynamic+solid is by saying 'No' to PhysicsOn and IsImmobile and this displaces the entity wall when triggered (as seen in the last part of the video).

Thoughts and comments are welcome. I am hoping to find a fix for this since it could be really sweet to have levels behave differently on every play.

That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 19th Feb 2011 03:13
I am trying to understand what it is you are trying to accomplish initially.
Are you trying to cut down on polygons in scene by dynamicly blocking out sections of the map until needed?
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 19th Feb 2011 03:37 Edited at: 19th Feb 2011 04:14
Quote: "I have spend my evening trying to make a proof-of-concept for FPSC where some parts of levels are removed from the game at run-time. It's a simple trick where I use a triggerzone to place an entity wall to cover up a doorway."


We too have been struggling with a similar concept. In our Egyptian game development, we attempted a similar idea. We were using the walls from the Dark Egypt pack where it looks like a solid wall but you can walk through them. I tried a regular wall and trigger to spawn it instead. Our results also yielded the same as you, where we could see the wall but walk through it.

We put that particular level on the sideline for now, but if you do find a solution, we'd be happy to learn what you found out. I was thinking back at the time if we needed to somehow script the main script to turn collision off (similar to the door script where collision goes off, then back on after the player passes through and the door closes). I had to do a similar coding step in another matter, where the appear script had a command in the script, but I still had to put that command into the main script as well to get it to work properly. I was not sure if it was because of the appear1 or appear2 difference.

**ADDITIONAL**

We also tried spawning a wall away from the segment section and put pillars on each side. It game the perception that the wall extruded a bit from the main wall. We were also thinking that it has something to do with the segments placed, as my wife was trying to create a situation where two pillars were standing, the player walked through a trigger which caused a "cave-in" and the pillars appeared to fall to their side. It looked realistic, but we could walk through the pillars. It was taking a lot of our time to try and sort that and like I mentioned before, we put it aside. If you decide you'd like some extra help, let me know and we'll be happy to set time aside.

**ADDITIONAL 2**

I found the thread I posted about the pillars issue. Not sure if it will help you out in any way, but you will see where we attempted different scenarios with blocking a hallway.

http://forum.thegamecreators.com/?m=forum_view&t=148003&b=23

- BlackFox

rolfy
20
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Feb 2011 04:19 Edited at: 19th Feb 2011 05:35
@Blackfox
I had the same issue with the maze walls in Eldora, where the walls are hidden in the floor and rise with the flick of a switch then fall again when the timer runs down.
What I observed if I remember correctly is that collision is placed where the entity is placed in the editor (where it will spawn in game)and does not move with the entity when animated in game.
The collision box for the door will remain at the position of a door when closed, its the reason you have to turn it off otherwise you cant get through, if you dont turn collision off you will find you can still walk through the animated open door model while collision is still placed in the opening of the doorway itself. (hope that makes sense)

I honestly cant remember fully how I solved this, all I can remember is doing things in reverse from usual, I would have to sit down and go through the whole process again to figure it out, but I can say it can be done.

@Scurvy
It actually looks like random spawning is having same effect as animating the object in a certain way. Not having looked at the idea too closely though I think you should try randomly destroying spawned entity,s first then randomly respawning to see if collision works better.

@Blackfox ADDITIONAL:
As stated collision will appear where the entity is placed in editor, you should place pillars as destroyed in editor, this entails doing your animation backwards (or copying the final frame of your animation to the be the first frame and simply jumping to frame two at spawn), it might also be best to turn of collision at same time if you want player to be able to able to pass under them first before triggering the destruction anim, after animation is triggered and collision is turned on you will find that collision is in right place.

I also found this from way back:
http://forum.thegamecreators.com/?m=forum_view&t=139567&b=28

If you ask me it would best to use animation on your walls in the same way I descrbed aove and try randomly triggering the anims rather than spawning.
Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 10:20 Edited at: 19th Feb 2011 10:21
Great to see that others have interest in this. I am going to work on this problem today and see if I can get anywhere.

And thanks for the link rolfy - it is an exact description of my collision problem but in more technical details.

I will post updates. Suggestions and comments are welcome

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 12:00 Edited at: 19th Feb 2011 12:03
Ok, one solution causes a new bug...

I tried using 'colon' in the appear script for the wall.


This sort of works but the collision box is misplaced completely. See the attached movie.

The collision box is about one meter in front of the newly spawned wall. I have no idea on how to fix this one

The level could be built to accomodate the bug I guess by having a longer passage towards every door. Not ideal, must test...

Comments and thoughts are welcome.

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 12:19 Edited at: 19th Feb 2011 12:19
Here's something. A solution that shall henceforth be known as

Ugly Hack from Hell but still a bit Awesome™

See video.

Simple solution really since I moved the spawned wall further down the corridor which placed its collision box in a place that doesn't obstruct the player in an unwanted way. To further enhance the feel of it I also spawned another entity (wodden support pillar) named the same as the wall so that something is placed on the collision box from the spawned wall.

It's not the ideal hack but I believe I am at a point where it's usable for a game.

Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 19th Feb 2011 12:25
What happens if you use something like:



I believe this script would hide the entity if activated, but I havent tested it.
Maybe the colon is unnecessary, dont know

Alamo
21
Years of Service
User Offline
Joined: 18th May 2005
Location:
Posted: 19th Feb 2011 12:35
You must build door segment which will look like a wall when closed. then use script which will open/close it to make "random" level.

I really doubt there is any other "universal" solution in the engine. You will run into problems described above when just using imported dynamic entities (plus I dont think its possible to adjust it properly in place for this effect in editor).

Hope this helps... Good luck!

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 12:37 Edited at: 19th Feb 2011 13:55
Cyborg ART: the result is the same with your script as the one I used. Collision box is still in front of the spawned wall.

Edit
Alamo, I missed your post since I posted something else while you did. I don't know if your idea will work but it could be tested.

Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 19th Feb 2011 12:47
What collisiontype are you using? How does the wallentity look like? Does the same thing happen to, i believe there are some, stock wall entities? If i dont remember wrong there is a wall that should act as a "hidden" wall.

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 13:25 Edited at: 19th Feb 2011 13:36
I have tried all types of collisionmode = X. It seems that this hack doesn't need you to define any collisionmode actually.

I tried a stock wall an it works a lot better with correct collision edit: but the texture I am using does not scale perfectly. All solutions have downsides I guess.

How do you define Spawn at start: No in the FPE file? I am trying to make a ready-made model for this.

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 13:45
I shot a video of the texture scaling problem when using the stock wall.

It has way better collision but also looks more out of place due to the texture not having the right scale compared to the walls next to it. Can the scale problem be fixed or is this embedded into the .x model file?

charger bandit
16
Years of Service
User Offline
Joined: 10th Nov 2009
Location: Slovenia
Posted: 19th Feb 2011 19:38
I guess a retexture of the model would be needed.


Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 20:10
I expect the same so I have decided to go with the Ugly Hack from Hell but still a bit Awesome™ solution that I found earlier.

I am building a level now where rooms are cut out by random chance and monsters also generate randomly. It's a royal mess really so I am looking forward to adding more randomness to that pile (weapons, gold, room furniture etc.)

rolfy
20
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Feb 2011 20:28 Edited at: 19th Feb 2011 20:34
Quote: "What collisiontype are you using?"

Quote: "I have tried all types of collisionmode = X"

To be perfectly clear since I hear this a lot, dynamic entities can ONLY have box collision.Wont make any difference what you change it to, stop wasting time with it.
Amodels collision box is calculated from the pivot centre of the modeling program not the model pivot to be certain of this you should ensure your model is correctly exported, if using Max ALWAYS reset xform before using any other modifiers.

Quote: "You must build door segment which will look like a wall when closed. then use script which will open/close it to make "random" level."

Since the door itself is a dynamic entity placed in a segment it wont make any difference if model is incorrect as explained above. It does depend on the modeling program, if you dont reset xform the model will revert to previous placement/scale etc when exported.
Its never a good idea to edit models fr this you must create your own from scratch and a simple box fr a wall should not be so difficult.
DarkJames
16
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 19th Feb 2011 20:42
Got some questions

1) Awesome texture, would be awesome to be released *wink wink
2) Would it be possible to add collision to that dynamic wall? so that the player cant cross it?

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 21:40 Edited at: 19th Feb 2011 21:47
DarkJames: All models seen are from official model packs. You must buy them to use them.

I have already posted a working script for setting up your dynamic walls.

Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 19th Feb 2011 22:47 Edited at: 19th Feb 2011 23:19
I may not be on the same page as everybody else but I thought there was a problem with a spawned entity not having collision as one issue. Here is the script I use:



Here is a youtube video of an entity spawning. I have the segment next to it to show that the collision has not moved away from the entity.

http://www.youtube.com/watch?v=COJKgZrq_94

The only issue I have found is that the entity walls I created using SignsV will not behave in like manner.

Addendum:

Although, my custom walls don't seem to work the entity scifi walls work.
Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 19th Feb 2011 23:32
Yes, I had a problem with dynamic entities and their collision. It was only when I added 'colon' to the appear script everything started working. Excellent with your script on how to fix it!

I now have auto-generating walls, enemies and room furniture in my level. Everything is working fine but it is a lot of work! I have never had this many trigger zones before

Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 19th Feb 2011 23:42
This is a very interesting and imaginative level. I think your efforts deserve a Danish beer ( if your old enough. )
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Feb 2011 00:07
@ Flatlander

Quote: "I may not be on the same page as everybody else but I thought there was a problem with a spawned entity not having collision as one issue. Here is the script I use"


I never had the colon in our appear script and by adding that, it fixed our issue with the pillars that appeared to collapse as the player walks past them. Now they don't pass through the pillars if they try to go back. Thanks for the assist.

@ Scurvy Lobster

Quote: "I now have auto-generating walls, enemies and room furniture in my level. Everything is working fine but it is a lot of work! I have never had this many trigger zones before"


LOL I know what you mean. I'll have to send you a screenshot of this level we are working on in our Egyptian development. Too many triggers to count.

The one with the least amount of triggers in their level buys the Danish beer.

- BlackFox

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 20th Feb 2011 00:28 Edited at: 20th Feb 2011 00:31
Flatlander: Don't worry, I am

I have attached a small video of a part of the level I am working on. Everything in the room is generated on random before entering the room. Also, a support pillar indicates a room that has been blocked completely off.

Guess I have to start counting triggers, heh. At one point I have 6-7 on top of each other. Cheers!

DarkJames
16
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Feb 2011 04:50
i meant the Texture from what pack is that?

Scurvy Lobster
20
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 20th Feb 2011 10:45
Model Pack 50.

Login to post a reply

Server time is: 2026-07-01 04:18:02
Your offset time is: 2026-07-01 04:18:02