The Daily Click ::. Forums ::. Klik Coding Help ::. GTA style buildings
 

Post Reply  Post Oekaki 
 

Posted By Message

vetmora120



Registered
  07/01/2010
Points
  273
12th April, 2011 at 08:49:52 -

Hey,

I know this question has been asked dozens of times in the past, but I can't seem to find any non-broken examples of it. I'm looking at implementing something similar to the 'GTA "3d" building illusion' into a current project. I'm not looking for anything too complex (even though it probably would be complex anyway), just something that will allow to create objects that have a height and move with the player.

Ultimately what I'm aiming to achieve, is something like 3 levels. The middle level will be where the player walks around and interacts. The top level is the top of the walls and the bottom level is for pits, holes, etc. If I'm not explaining myself well enough, please ask.

Thanks in advance!

 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
12th April, 2011 at 12:19:25 -

Someone had created an example of an engine that created skyscrapers of several levels in height. It's along with an example of a musically-activated equalizer bar that reacts to the wavelengths of the sound sample. Do a search for engines and examples, and you'll most likely find it. From what I remember/know of the original GTA, chances are that effect can be replicated with this example.

Additionally, you may be able to use the parallax object to do what you're trying to do. There are some impressive examples with the Clickteam updates.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
12th April, 2011 at 13:18:06 -

Thanks for your help. Had a search for that example you mentioned. No luck as of yet. Also had a play around with the parallaxer object. Trying to get my head around it and figure out how to do this.

If anyone else has any luck on this, keep me posted.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
12th April, 2011 at 13:47:36 -

I believe it was Shab who posted an example of a "3d" voxel engine. And since I'm such a nice person I found the link for you.

http://www.create-games.com/download.asp?id=5793

Though the last comment state it's a dead link, but you can check it out anyway, or just pm Shab.

//EE

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

vetmora120



Registered
  07/01/2010
Points
  273
12th April, 2011 at 13:55:21 -

Yeah, I did find that one. But yeah, the link is broken as I discovered earlier. Thanks for trying though!

Oh and I already did pm Shab. Havn't heard from him... hmmm

 
n/a

nim



Registered
  17/05/2002
Points
  7234
12th April, 2011 at 14:34:18 -

I still have the example made by Shab. If I remember correctly, I added scrolling (arrow keys) and converted it to .mfa to upload it to Aquadasoft but nothing else has changed.

http://mfa.aquadasoft.com/upload/1302613652-3dvoxel.mfa

 
//

vetmora120



Registered
  07/01/2010
Points
  273
12th April, 2011 at 14:37:58 -

Thank you Nim!!! Really appreciate this!

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
12th April, 2011 at 16:21:28 -

Hmmmm, I've put this into my game now but because the sprites are always being created they flicker randomly. I'm sure there's a better way to optimize it. Anyway, yeah. If anyone has any ideas on that then please let me know! ;D

Thanks, Vet

 
n/a

Johnny Look

One Happy Dude

Registered
  14/05/2006
Points
  2942

VIP Member
12th April, 2011 at 18:47:05 -

Trying to do this in mmf2 is a bit of a lost cause, I'd recommend you to to use construct instead.
With it you can export and render 3d model which is then treated as a 2d sprite by the runtime, I can't think of any easier way to do 2.5D like you want.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
12th April, 2011 at 18:53:59 -

Lost cause? Then you need to do some math dear boy.
Using a bit of trig and a few values this can be made "rather" easy and fully stable.

It's all a matter of positioning objects relative to the camera in the right scale and with the right offset. The scale and offset are found using distance calculations while the scale is set initially.

//EE

Edit: Silly me using than instead of then!

Edited by Eternal Man [EE]

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
12th April, 2011 at 19:32:25 -

Johnny Look: Hardened MMF2 Veteran

Edited by GamesterXIII

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
12th April, 2011 at 20:49:05 -

I've got it still, and it works in MMF2 and I've updated it just a bit. My Abandonware pack has it in there.

 
Craps, I'm an old man!

Johnny Look

One Happy Dude

Registered
  14/05/2006
Points
  2942

VIP Member
13th April, 2011 at 03:02:14 -

geez people really need to chill out, whenever construct is mentioned there's has to be someone to go all guns blazing.

eternal man: what's easier, doing the trigonometry calculations and everything else you said or simply loading a mesh ?

GamesterXIII: I think I can safely say I'm more experienced with mmf2 than you.



 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
13th April, 2011 at 03:11:43 -

Of course it'd be easiest to load a mesh.

However.

It also means means to abandon a language/system that you know, for something completely new that you aren't used to.
And if that's the case you will probably end up not finishing it even more than if you'd just stuck to the concept you know, albeit it meaning more calculations and such.

//EE

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
13th April, 2011 at 03:45:42 -


Originally Posted by Johnny Look


GamesterXIII: I think I can safely say I'm more experienced with mmf2 than you.




I laughed pretty damned hard.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
13th April, 2011 at 03:50:38 -


Originally Posted by GamesterXIII

Originally Posted by Johnny Look


GamesterXIII: I think I can safely say I'm more experienced with mmf2 than you.




I laughed pretty damned hard.



Safe to say, he loled...

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Johnny Look

One Happy Dude

Registered
  14/05/2006
Points
  2942

VIP Member
13th April, 2011 at 03:54:45 -

Construct and mmf2 are so similar in everything I doubt that would be much of a problem-
It's not a new language in any way and doesn't feel entirely new at all, on the contrary one of the most common complaints (here anyway) about construct is that it's a rips off mmf2's interface and architecture.


 
n/a

Johnny Look

One Happy Dude

Registered
  14/05/2006
Points
  2942

VIP Member
13th April, 2011 at 03:59:01 -


Originally Posted by GamesterXIII

Originally Posted by Johnny Look


GamesterXIII: I think I can safely say I'm more experienced with mmf2 than you.




I laughed pretty damned hard.



You have a pretty weird sense of humor then.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
13th April, 2011 at 04:10:39 -

Too much talk, too little help Nah only joking guys, thanks for all your help, guys.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
13th April, 2011 at 04:11:56 -

Get this boy a Best Comedy Album Grammy. Best comedian I've ever seen.

ps. Sorry vetmora.

Edited by GamesterXIII

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
13th April, 2011 at 04:14:58 -

Apology accepted. Oh hey by the way guys, this thing still flickers even with that new slighty updated version. Hmmm...

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
13th April, 2011 at 04:32:19 -

Does the whole screen flicker or is it just an/some active/s?
Check if you've got conflicting animation changing- or direction changing events. Most of the time, you've just forgotten something somewhere.

//EE

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

vetmora120



Registered
  07/01/2010
Points
  273
13th April, 2011 at 04:52:38 -

Nah, only the objects that are created for the Voxel effect flicker. It's mostly when the player is moving and/or the mouse. The actives are always being created and always being destroyed so it always updates their relative position to the player.

Oh I just found what it seemed to be... I had an event to check if the bullet collided with the voxel wall effect then destroy the bullet. I changed it to the parent wall object and it seemed to do the trick... strange... But YAY

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
13th April, 2011 at 14:23:44 -

You should post the mfa file of what you've done so far. I'd love to see it!

 
n/a

Johnny Look

One Happy Dude

Registered
  14/05/2006
Points
  2942

VIP Member
13th April, 2011 at 14:41:03 -


Originally Posted by GamesterXIII
Get this boy a Best Comedy Album Grammy. Best comedian I've ever seen.

ps. Sorry vetmora.



Meh, I've seen better trolling attempts from you. Still, thanks

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
13th April, 2011 at 14:50:24 -

@Chris Burrows

Here's the link for the project as you requested: http://dl.dropbox.com/u/9919361/Project.mfa

Press space during runtime to toggle the testing mode. Turns out the flickering is still there at the moment... anyway enjoy!

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
13th April, 2011 at 21:24:11 -

I've just done a quick once over and have to say that I'm stumped. There is no reason it should do that, yet it does...

That being said, I cannot replicate that issue in any of my versions of the engine. So I'm stumped.

Seems to happen more when the mouse cursor is over the voxel ob. But now that I think about it; it could be a collision/ordering on the y axis problem.

 
Craps, I'm an old man!

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
14th April, 2011 at 02:43:22 -

Well done that looks great! Very smooth too.

Also..... could somebody reupload the 3dvoxel.mfa file?
For some reason my computer won't let me go to http://mfa.aquadasoft.com

Thanks!!!!!!!!!!

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
14th April, 2011 at 03:30:23 -

http://dl.dropbox.com/u/9919361/1302613652-3dvoxel.mfa

There you go Chris. Thanks for the compliments and the help again too, guys. I've tried disabling certain groups/events but still no dice.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
14th April, 2011 at 03:39:40 -

Cheers!

I'm pretty sure though GTA actually uses real 3d buildings. Not real 3d. But kinda like in Doom, raised and lowerd floors, a few angles too. Probably more like Duke 3d. But it couldn't have a 3d object floating around in the air somewhere. The cars and pedestrians were all 2d sprites. The overpasses were too from memory.




 
n/a

nim



Registered
  17/05/2002
Points
  7234
14th April, 2011 at 11:53:43 -

This pseudo-3D effect reminds me of Red Zone on the GenesisMegadrive. Anyone remember that?

http://www.youtube.com/watch?v=NS41gxi0dTU&t=384

 
//

Alonso Martin



Registered
  29/12/2010
Points
  294
14th April, 2011 at 14:37:14 -

That game looks amazing! I never even knew it existed

 
www.hfalicia.com
www.alonsomartin.mx

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
14th April, 2011 at 14:59:53 -


Originally Posted by Chris Burrows

I'm pretty sure though GTA actually uses real 3d buildings. Not real 3d. But kinda like in Doom, raised and lowerd floors, a few angles too. Probably more like Duke 3d. But it couldn't have a 3d object floating around in the air somewhere. The cars and pedestrians were all 2d sprites. The overpasses were too from memory.



In GTA, the scenery was 3d and grid-based - composed almost entirely of cubes (plus a few slopes). Different textures could be applied to each of the 5 sides of each cube (not including the bottom).

I think your best bet for something like this, would be to find/create a pixelshader similar to the Perspective shader, but also capable of skewing the image. You could then use that for each of the 4 side walls; and another normal active for the roof.
That way, you could have very detailed, textured 3d buildings using just the 5 objects.

Edited by Sketchy

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
19th April, 2011 at 04:56:59 -

Hey Sketchy,

Thanks for the advice. Can't seem to find any pixelshaders like this around. How would I go about creating my own?

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
19th April, 2011 at 09:02:19 -

If you could make an example that would be amazing!

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
19th April, 2011 at 10:01:48 -

Actually I found a 3d shader located here in this example: http://www.mediafire.com/?bse0i0nbyuv

Still trying to figure out how to use it and apply it to a top down game like mine.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
19th April, 2011 at 12:27:55 -

Nice find! Looks like it should do the job.
I'll see what I can come up with...

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
20th April, 2011 at 10:37:15 -

I've been experimenting, and it's definitely do-able (I'll have a demo for you by tomorrow hopefully - too busy again today).

btw: Do you know who made that 3d pixel shader?
I'd like to report a bug I found (don't worry, I found a workaround, so it's not critical).

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
20th April, 2011 at 11:18:25 -

What was the bug?

I played around a little with it myself and I must say, damn, how cool it is!

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
20th April, 2011 at 11:27:18 -

It doesn't work quite right unless you either:
* Set RGB coefficient to something other than pure white (254,255,255 works fine),
or
* Set Blend coefficient to something other than 0.

You'll be able to test it yourself when I upload the example...


 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2011 at 01:23:44 -

Okay, so I put together a rather shoddy and uncommented demo.
There's loads of room for improvement, including optimizing it to improve performance (eg. You only need either a left or right wall, and either a top or bottom wall, as you can never see both at the same time; plus the coding could be much better).
I may get around to finishing and commenting it eventually, but to be honest, I'm bored of it right now.

The download is here: http://cid-b1e7ee094271bbda.office.live.com/self.aspx/Public/3dBuildings01.mfa

If anyone other than Vetmora wants to take a look, you need to download and install the pixelshader that he linked to earlier in this thread.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
21st April, 2011 at 01:32:49 -

how do you install the shader? cheers x

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2011 at 01:36:34 -

Just extract the contents of the zip/rar to:
.../Multimedia Fusion 2/Effects/

Image

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
21st April, 2011 at 01:48:41 -

I extracted "3d Shader.fx" and "3d shader.xml" to Multimedia Fusion Devloper 2/Effects and it still doesn't seem to work for me.
There was no Effects folder already, I had to create one?

Image

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2011 at 01:54:33 -

You are using the HWA version, right? It won't work in the standard build.
The fact that there wasn't already an Effects folder makes me think you probably haven't installed it yet?

Download:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=220648#Post220648

Edited by Sketchy

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
21st April, 2011 at 02:37:02 -

yeah that was it. thanks!

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
21st April, 2011 at 02:58:12 -

Fantastic job there Sketchy!

And as of out of the blue, we now have some very nice 3D capabilities in the community. Who would have thought?

Would be very interesting to know who made the shader.

Sketchy, you should upload the example to TDC so that others may know about it.

Then an admin should frontpage it!

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

vetmora120



Registered
  07/01/2010
Points
  273
21st April, 2011 at 03:16:48 -

Yes! Thanks Sketchy, great job! Unfortunately I can't remember who made it or where I got linked to it from. I found it extracted in my downloads folder when looking for something else and thought "I don't remember this but it's exactly what I need" lol.

Thanks again everyone for your help ;D

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2011 at 03:19:18 -

Apparently the shader is made by someone called "Werbad" on the clickteam forums.
I just searched the forums there, and found a thread exactly like this - with someone wanting to make a GTA style game, and someone else suggesting the use of the very same pixelshader...
But at least noone had submitted an example, or I'd feel pretty silly having wasted my time

I think it still needs fixing up a bit more before I submit it to the downloads section, but thanks

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
21st April, 2011 at 03:23:16 -

Oh right, now that does sound familiar. You're right it was Werbad. I had a crack at it myself and came up with something similar but yours is way better

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st April, 2011 at 11:15:25 -

I've submitted a new & improved version to the downloads section, here:
http://www.create-games.com/download.asp?id=8446

Enjoy

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
25th April, 2011 at 07:55:33 -

Relating to the voxel engine, I believe the issue may lie with setting the position of the 3d Camera to your player. Make the 3d object your player and then move your animations over it.

 
Craps, I'm an old man!

bigredron



Registered
  07/04/2007
Points
  299
9th May, 2011 at 01:26:52 -

posting so i can look at this when i get home

 
n/a

staleningrad



Registered
  22/07/2011
Points
  1
22nd July, 2011 at 02:52:45 -

Hi. Sorry to bump this, but I would really like to figure out how to remove the walls that are between buildings placed right next to each other. This would probably keep the frame rate high and remove some of those visual clipping issues. Does anyone have a solution?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click