Product Chat / EBE, AI and Stairs (semi tutorial)

Author
Message
Defy
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 4th Apr 2018 18:49 Edited at: 11th Jun 2019 01:40
Working now in latest dx11 March version - outdated information.

Attachments

Login to view attachments
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Apr 2018 20:36
Here's the second model we discussed

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.

Attachments

Login to view attachments
Stab in the Dark software
GameGuru TGC Backer
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location: Upstate New York USA
Posted: 4th Apr 2018 20:52
Quote: "EBE stairs or static entity stairs currently give the best results in dynamic."


What exactly do you mean by this. What is dynamic?

Quote: "The current EBE stairs has some collision problems when joining walls. "


This is because Lee is incorrectly creating a compound collision shape for the EBE structures.
The coffee is lovely dark and deep,and I have code to write before I sleep.
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 5th Apr 2018 11:10 Edited at: 5th Apr 2018 19:49
Seems the problem is with the waypoint node not connecting with the terrain.

I have found an alternative solution:

1. Make your EBE structure as normal, using the EBE stairs (not a separate model).
2. Erase the piece of floor at the foot of the stairs.
3. Place floor zones where you want NPCs to go.
4. Place a waypoint extending from the patch of terrain at the foot of the stairs up to the next floor at the top of the stairs.
5. Press E.
6. Place a new EBE building site.
7. Within the new site place a piece of floor matching the one you erased from the first site.
8. Press E.
9. Extract the piece of flooring you just created and drag/drop it into the gap you made in your first structure.
10. Save the piece of flooring as an EBE structure.
11. Edit the flooring's FPE file: collisionmode = 0

Worked for me. The trick is to make sure the waypoint stays connected to the terrain. This, of course, only works for ground floor stairs.

However, it is possible to get an NPC to go up/down EBE stairs by using a floor zone and a waypoint. It is extremely fussy but it can be done.
Julian - increasingly disillusioned and jaded
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 5th Apr 2018 11:36 Edited at: 5th Apr 2018 11:36
@STAB-Making an entity dynamic, such as an EBE building or barrel or character, you can add LUA scripts to them. On a side note, I found when creating my apps, that NPC's work better if a building is set as dynamic. They respond better, but that was a few months ago when revisiting glass breaking for FPSC levels. IF I made an FPSC level that I'd imported into GG and set that level to dynamic and added a couple of character enemies, they climbed through the windows (when broken). With building set to static they didn't do much just looked lost.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: SegAutoWelder, Entity+Weapon Welder, FPEtoBAT, DBO2X
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 5th Apr 2018 21:19
This seems strange to me. I have an EBE structure with three levels. Only the first set of stairs (which are the EBE stairs) has a floor zone. The second set of stairs doesn't have a floor zone. Yet an NPC is able to go up the stairs. Is this normal?

BTW, I am using smallG's altered module_combatcore.lua script to minimise getting shot through walls.
Julian - increasingly disillusioned and jaded
PM
Stab in the Dark software
GameGuru TGC Backer
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location: Upstate New York USA
Posted: 5th Apr 2018 22:12 Edited at: 5th Apr 2018 22:19
Quote: "@STAB-Making an entity dynamic, such as an EBE building or barrel or character, you can add LUA scripts to them. On a side note, I found when creating my apps, that NPC's work better if a building is set as dynamic. They respond better, but that was a few months ago when revisiting glass breaking for FPSC levels. IF I made an FPSC level that I'd imported into GG and set that level to dynamic and added a couple of character enemies, they climbed through the windows (when broken). With building set to static they didn't do much just looked lost."


Well, then this is one of the major problems with GG. Buildings should NEVER be DYNAMIC.
Setting an entity to DYNAMIC causes GG to make the entity a dynamic physics object.
The more DYNAMIC objects the physics solver has to handle the slower GG runs.
Only entitys that will be moved by physics (e.g. a rolling barrel) should be DYNAMIC.
All other entitys that will be not be moved by the physics engine(e.g. a stationary building) must be STATIC.
Seems very wrong that an entity needs to be DYNAMIC to have a script attached to them.
Another slow down is that GG creates a DYNAMIC NPC controller which when interacting with
say a building that you have made DYNAMIC adds to the work load of the physics solver.
The NPC should be Kinematic only. Kinematic interacting with STATIC objects do not
slow down the physics solver.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Defy
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 6th Apr 2018 15:55 Edited at: 11th Jun 2019 01:40
Updated first

@Stab in the Dark software . Hello. Oh, yes dynamic stairs. Don't worry I know it wasn't the best option, though an option.
Thank you also for explaining physics solver and helping me make the decision to search for a new option.

@lordjulian , Great work around with waypoint. And thank you for your information for others also.

@Bored of the Rings, Out the windows. very nice. Yeah dynamic shows interesting results, I noticed a slight barrier and letting the Npc glide down the stairs.
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 6th Apr 2018 17:41
Are you basically saying the NPCs will climb stairs as long as there are 22 steps?

I have found I can get them to do any number using a floor zone. Trouble is if I try adding a second floor zone it breaks this AI.
Julian - increasingly disillusioned and jaded
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 6th Apr 2018 18:01
OK. Thanks, Defy. My NPCs are now using stairs flawlessly (no pun intended) just with waypints. The key seems to be the polygon collision plus extending view range.
Julian - increasingly disillusioned and jaded
PM
Defy
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 7th Apr 2018 10:47 Edited at: 11th Jun 2019 01:40
@Lordjuilian, You're welcome. Happy game dev.
PM

Login to post a reply

Server time is: 2024-10-06 14:35:46
Your offset time is: 2024-10-06 14:35:46