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.

AppGameKit/AppGameKit Studio Showcase / Universal 1st/3rd person AGK framework(without physics)

Author
Message
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 21st Mar 2018 23:11 Edited at: 14th Dec 2018 18:01
[WIP]

PREVIOUS VERSIONS:

Download an earlier version including executable+source and blendman's mods(moving platforms & bonus collection) here to try if you like.
Source + Exe Download


Source Download V6.8


LATEST VERSION:

Source Download V6.9

NOTES:
1) Do *not* use IE for download for it can't handle the nasty popups of MediaFire - I use Chrome to avoid.
2) Release is in RAR format as is too large and consists of too many separate files now to update in codebox(es) every time. Will do in the final release.
3) For changes, see history in begin of main.agc.
4) Currently not all geometry and functions included in the download to keep focus on the multiplayer part and basic functionality.

Objective: flexible controller for 3d games without physics.
Features:
-switch between 1st / 3rd person cam
-player to obstacles collisions
-player to ground(either plane, other objects or terrain)
-jumping
-networking
-etc, etc ..


THANKS TO:
-TGC for proving AppGameKit
-Janbo for initial basics of the ObstacleAvoidingCam routine.
-Sphinx for fixing cam turnbug using A and D keys.
-blendman for moving platforms example and bonus pickup(not currently included for keeping oversight while doing code restructuring for multiplayer - will put back later when all working as desired) and double collider suggestion(still needs implementing).
-puzzler2018 for the procedural texture function(currently removed- might put back in later if he likes).
-The guys at SyntaxBomb(nearly forgot )
-And many others of course..

ROADMAP (not necessarily in this order):
Fase1 - Cam/Player handling.
- Add Android buttons for turning round (currently only forward/backwards and left/right strafe)
- CarCam mode ?
- Put back other routines I took out previously.

Fase2 - Collectables/ Fire mechanisms.
- Create bullets collision detection.
- Scorch marks for bullet impact.
- Create item mngr a la jeppe's
- Ammo boxes/ bullet system/inventory/scorches/bullet holes, grenades righthand?
- Target image? /zoom mode?
- Labels /energy levels above players. (decreasing health by movements, jumping costing more..

Fase3 - Environments.
- Terrain.
- Teleports/spawn points, moving platforms(removed for overhaul)
- Clouds, sun, rain, snow?
- Foliage?

Fase4 - Enemies/bots.
- NPC(follower/clingers) A*, AI
- Circling birds?

Fase5 - Networking.
x Universal Networking Front End interface/framework (separate from this release, still in alpha stage- looks nice though )
- Peer2Peer (networking stack, msgs)
- Hosting/matchmaking Server?

*Not currently included in the download, still in progress.

Ideas:
- Level name : "The Green, the Red and the Bluie"
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 22nd Mar 2018 01:49
Wow, i try this after work, looks useful!
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 22nd Mar 2018 07:19 Edited at: 24th Mar 2018 06:29
It's getting there, but still lot's of stuff to be done. Progress is bit slow as I have to dose my time very well due to work and health issues.

I've split up the code so cannot really post it in a single code block anymore for will be too messy, lots of post's, so just put up a RAR archive for easy download.
Will post all in code blocks when completely done, for file hosting services can go down of course.

There's a bug with MacOS regarding the mouse look code as was brought my attention by Qube of SyntaxBomb. Apparently it's a bug of AppGameKit and there's a thread on the TGC forums about it that hasn' t been addressed yet. Qube said he'll bring it to AGK's attention so hopefully will be fixed.

Link to MacOS bug thanks to Qube https://forum.thegamecreators.com/thread/220725:
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 23rd Mar 2018 10:06
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 23rd Mar 2018 15:25 Edited at: 23rd Mar 2018 15:32
Hi

I have tried it, it's cool, but not universal .

If you change playerheight#= 120, the player isn't on the ground.

An idea to change that ?
AGK2 tier1 - http://www.dracaena-studio.com
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 23rd Mar 2018 17:08
Cool project Rick! I still need to check it out. Will try to do that this weekend.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 23rd Mar 2018 19:13 Edited at: 23rd Mar 2018 19:48
Thanks guys. It's very much a WIP

@Blendman

Quote: " I have tried it, it's cool, but not universal ."


Indeed it's more or less 'Universal' hehehe.

Quote: "
If you change playerheight#= 120, the player isn't on the ground.

An idea to change that ?"

Weird. Need to look into it, but probably have to change the Y value to be half the playersheight.. Probably made a mistake somewhere..

[EDIT]
Tested. I've doubled the playerheight# and got this as result:

So, that works, but when the player moves up a slope then partially sinks into it. The collider routine indeed isn't universal:
Quote: " object_hit = ObjectSphereSlide(0, oldPlayerX#, oldPlayerY#, oldPlayerZ#, newPlayerX#, newPlayerY#, newPlayerZ#, playerwidth#)"


And as playerwidth# isn't representative for playerheight#... hence the weird effect.
Good point. Will have to rethink this part.

We'll probably need at least 2 colliders: 1 as a spherecast for surroundings and 1 as sphere or raycast for below the player the player. This will also solve some other issues rightaway.
That is actually how I've done things before in Blitz3d so I shouldn't be surprised actually.
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 23rd Mar 2018 20:07 Edited at: 23rd Mar 2018 20:13
On slopes using 120:


A quick:


Gives this:


But the drawback is of course: the player isn't as width as he is high, so will make it more difficult to pass through narrow obstacles.
It's because initially I've started this of as a sphere and then change the player into a capsule.

Thanks for bringing this up, indeed 2 colliders are required.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 25th Mar 2018 19:57
And if you use 2 colliders of the same size (capsule height 72, width40), one for the feet and the other for the rest and the head ?

First you try for the feet, then for the head, but dont change the y for the collider of the head.
AGK2 tier1 - http://www.dracaena-studio.com
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 10th Apr 2018 09:47
Yes, i think put one collider between knee and feet,cast in short distance every time it detect a collision, position the mesh with the height of the difference between feet and the collider.

Good project BTW.
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Apr 2018 14:04
Thanks, still working on it. Collider bug will be fixed later. Currently checking if can get it to do multiplayer.
nonom
7
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 14th Apr 2018 19:31 Edited at: 29th Apr 2018 15:04
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 18th May 2018 13:24


This might help it's a random number generator which allows you the same results no matter what.
-EdzUp
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 19th May 2018 06:42
it's super pretty !!! I just love it ::
I do what i do !!!
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 19th May 2018 17:04
Well, pretty is hardly the word hehehe.

But, when done, should be a nice example for a simple 3d multiplayer game for those who never encountered it.





fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Jun 2018 07:12
Nice project Rick Nasher
fubar
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 7th Dec 2018 23:25 Edited at: 9th Dec 2018 13:31
Ok, as blink0k referred in the thread "[SOLVED]3d Physics Demos" to this project -which was kinda on hold- I couldn't resist to check back at it( which is not all that good for me actually, but hey.. )


Re-did some things to make it more modular for the multi-player preps and also reduced FPS drop, caused by shadows on my low spec, ancient machine.
So can now choose between 3 shadow modes: optimized for speed, quality or a compromise between those two(default).



However I noticed an odd behavior:
-When turning round 360degrees in 3rd person cam mode, it appears the player object moves upwards a little (in the Y direction), perhaps while passing over it's own shadow??
-At same time happens also for the other 2 player objects, even while I'm only controlling the 1st player object?!



Can't really figure out why, as PlayerY variable remains the same and the other 2 players aren't linked to the controls at that time..
Wondering if it's an optical illusion, but don't think so.


Can anybody please confirm/debunk this odd behavior?
(control rotation by pressing A, D or using the mouse)

Sources Download Link(as usual) on:
http://www.mediafire.com/file/2w05fty0l510mdj/U3D13P_FW_V6.9.rar/file
*Do not use IE for download for it can't handle the nasty popups of MediaFire(I use Chrome to avoid).
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 9th Dec 2018 09:25 Edited at: 9th Dec 2018 09:30
Still puzzled here.
(I don't think it was acting like this in the past).

Wonder if related to the effects noted in this thread by fubarpk:
"Has anyone else noticed when you rotate objects on y axis it moves the fixed objects on y axis"

Need to do some tests.
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 10th Dec 2018 21:22 Edited at: 10th Dec 2018 21:34
Ok, plot thickens:

To determine if my player model actually really raised from the terrain surface when rotating 360 degrees, I had put up a striped measuring pole, static object for reference.
But:
1. Appears the height doesn't change in conjuction to this or it also moves upwards,
2. When used different shadow modes it doesn't show.


Shadow mode 2 - the anomaly only occurs in this mode:


Shadow mode 1 - all fine:


Shadow mode 3 - all fine:




Possibilities:
1) Either it's just an optical illusion only present in shadow mode 2.

Or:
2) All objects, to which the object's shadow has been cast in mode 2, lower itself.

Or:
3) The shadow map gets displaced.

My best guess is option 1 or 3 or there's a serious bug in the gfx renderer.

Quote: "
SetShadowMappingMode
Description
Turns shadow mapping on or off, by default this is off. Shadows are only generated by the the global directional light, which can be controlled with the SetSunDirection command. Note that this is not guaranteed to be supported on all devices, you can check for the current device by calling GetShadowMappingSupported. There are currently three shadow modes that can be used, mode 1 uses Uniform shadow mapping which has lower but consistent quality. Mode 2 uses Light Space Perspective shadow mapping (LiPSM) which has higher quality in most cases but if the camera is looking in the same direction as the light then it is no better than Uniform shadow mapping. Light Space Perspective also suffers from shadow shimmering as the camera moves whereas Uniform is more stable. Both have about the same performance. Mode 3 uses Cascade shadow mapping which uses multiple shadow maps to maintain high quality near the camera whilst still allowing lower quality shadows in the distance. This method has much lower performance than the previous two methods but results in better quality shadows in all cases.

Note that when using modes 1 and 2, texture stage 7 on all objects receiving shadow is reserved for the shadow map. When using shadow mode 3 (cascade shadows) then texture stages 4, 5, 6, and 7 are reserved for the shadow maps.
"



Strikes me rather odd that it *does* look good in mode 1.
It looks like the shadows get displaced, do no longer touch the models at the base, giving this strange illusion that models moved up in Y direction when rotating the model 360 degrees.
Perhaps someone can shed a little light on this? (RickV?)
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 11th Dec 2018 15:27 Edited at: 11th Dec 2018 15:29
- Added a quick texture to ground(borrowed from blink0k, hope you don't mind) for testing purposes, as was suggested by someone.
- For testing I also lowered it into the ground so the cam could see in between the other player models and the ground, but couldn't see through.

@blink0k
Quote: "It is the nature of shadows and what you see. The little bit of background that shows through in the first instance makes you think it's off the ground."

- Might very well be.

Quote: "I bet if you coloured that in a image proggy you wouldn't notice the difference."

- Looks little odd:
Appears shadows are displaced more in mode 2 then in mode 1, while none occurs in mode 3(slowest). Just put these up for comparison

mode1:


mode2:


mode3:


Cam angle also appears to have something to do with it.
It's especially clear when rotating round a pole like object:



That's a little too much animation, but easier to see what I mean. Mode 2 is definitely got more displacement of the shadows. Ah well, I've made it user selectable.
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 11th Dec 2018 16:41 Edited at: 11th Dec 2018 16:49
Little update(selectable shadow mode) for who wants to try.

Sources Download Link below for has multiple files and is too large to post here every time:
http://www.mediafire.com/file/hncqsa6jkyhuggw/U3D13P_FW_V6.9.rar
NOTE: Do *not* use IE for download because it can't handle the nasty popups of MediaFire(I use Chrome to avoid).
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 19:53
Have you tried SetShadowBias( bias )?
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 12th Dec 2018 10:46 Edited at: 12th Dec 2018 17:48
Yep. No go. Not effecitve. Perhaps due to the large scale I'm using to retain compatibility with the physics system.. dunno really.

[EDIT: and I'm not biased. lol ]

[EDIT: even tried negative values, as I actually hoped to achieve the opposite(shadow closer to object, but nogo )
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2018 04:17
Don't forget you could scale it down and change the physics scale. I know that works
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 13th Dec 2018 23:04
@blink0k
I've just scaled up as Stab insisted would be necessary to avoid tunneling in physics.
But if no need, should be easy to scale back. Will keep it in mind.
Time will tell..

Put latest version up to first post as you mentioned and thought would be good idea indeed.




blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2018 03:33 Edited at: 14th Dec 2018 03:39
Just remember if you scale it down. Scale down the Create3DPhysicsWorld( scaleFactor ) scale factor.
The default is 40, which is probably what you're using now

The top link downloads U3D13P_FW V6.8.rar But there is another link there that says v6.9 but it goes nowhere
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2018 18:10
@blink0k
Currently not using physics yet in this version, but I indeed was taking into account scaling factor 40 for future adaptations.
Will keep it in mind,

Something went wrong with the mediafire link. First time I tried to upload an edited version had to delete the file already there for wouldn't overwrite.
Apparently copy paste held onto that original link, which of course, is no longer effective. Corrected now.

I have a habit of checking links, but exactly the time I didn't you'll see it messed up. lol Thanks for letting me know.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 28th Dec 2018 19:03
Quote: "Yep. No go. Not effecitve. Perhaps due to the large scale I'm using to retain compatibility with the physics system.. dunno really."


What values did you use for SetShadowBias(value) ?? Because I noticed I usually had to use something quite small like; SetShadowBias( 0.0012 )
I don't know how the effects of that command scales with larger level geometry though.
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 2nd Jan 2019 14:48
@PHeMoX
Indeed normally the very small values do the trick.
Unfortunately I had already tried both very low, a medium setting and high values (according to scale and up) to see if any of it would make a difference, but to no avail.

But thanks for thinking along.

Login to post a reply

Server time is: 2024-11-23 09:38:55
Your offset time is: 2024-11-23 09:38:55