Scripts / Possible to detect walls?

Author
Message
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Nov 2018 03:28 Edited at: 29th Nov 2018 03:34
Hey all, Ive been bouncing around many different ideas and prototypes with Game Guru to see what kind of game i should make. I started playing around with the idea of a grid based system. Similar to Dungeon Crawler first person games. Where the player controls are overwritten by a slower based system that falls in a grid. I got the movement working great. However I have no way of detecting walls.

Similar to this


Is it possible to detect static EBE walls or entities?

I'm curious as i have situations where the player is in a hall and i dont want him to walk to the right or left if there are walls there. Perhaps a very complicated task and not right for Game Guru? I'm assuming this gets into complicated territory using raycasting.

One option i think i can try to do is create invisible walls that box in the player more to a more narrow path despite how spacious a hallway might seem.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Nov 2018 03:46
the more i look into this the more code it looks like i would have to create just to get the level design working within a grid system. Not sure its something i want to pursue :/
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Nov 2018 20:03
Raycasting detects walls.
Been there, done that, got all the T-Shirts!
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 2nd Dec 2018 10:31
@Teabone, WOW , is that your game. its Wow.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Dec 2018 13:44 Edited at: 2nd Dec 2018 13:47
Simply make the collision shape of the walls larger? If you made the walls as a capital 'I' shape but choose simple box collision mode then that should have the desired effect.

If your map is completely grid based then you shouldn't need ray casting (although it wouldn't be that complicated) as you should be able to work out where the player is relative to the walls mathematically.

Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 19th Dec 2018 05:55
Quote: "@Teabone, WOW , is that your game. its Wow."


I wish it were lol though i do believe something like this might be possible in GG. Someone managed to do a dungeon crawler like this in FPSC back in the day.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jan 2019 21:34
Is there a Raycasting function in GG lua? (If no, where might I find some hints on coding that?)
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jan 2019 21:45
Teabone- I watched the video, and a possible (obviously not perfect) solution might be-- because it sortof seems to be the walking physics of the game in the video-- would be to allow the player to walk forward a certain amount of distance (vigorously controlled), let's say every wall or hall block is ?? 300 units, okay then allow the player to move any cardinal direction by 300 units, and if the level is created properly (of course this limits the complexity of the level), but if done right, they would be forced to stay centered in the halls. Now, they wouldn't have to leap immediately 300 units in a single script loop, but you could check the variable and limit it each "move" to the 300 or whatever number fits. Get what I mean? The player presses "W" and in the course of 2-3 seconds or so, they walk forward __#__ units. Seems like if using the EBE blocks for the mazes, it would be all that much more viable?

Again, it sortof looks like the method they used in that game-- but probably not. Just a thought, though of course this is pretty crude obviously, but shouldn't be too difficult to script?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Jan 2019 21:46
Yes, it's documented in global.lua.

In fact there are two, one for terrain and one for entities. RayTerrain & IntersectAll.

If you take a look at utillib.lua there is a function in there called ObjectPlayerLookingAt which shows how the second one can be used.

In fact there some really useful functions in there you may find interesting.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-22 14:00:08
Your offset time is: 2024-12-22 14:00:08