Jump to content


Photo
- - - - -

How To Make A 3d Tds Mixed With 2d Characters


  • Please log in to reply
13 replies to this topic

#1 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 12 January 2010 - 11:11 PM

  • Title: How to Make a 3D TDS mixed with 2D sprites
  • Description: Tutorial on how to make a TDS using 3D for the world and sprites for the characters. Includes how to add lights as well
  • GM Version: GM 7 or 8
  • Registered: yes
  • File Type: .gmk
  • File Size: ~80k
  • File Link: GM8 File GM7 file

Additional Info
UPDATE::
GM7 version is now up to date with the GM8 version, I even add some other new things like camera lock which makes it so when you press the "C" button the camera rotates and stays behind the player and when its not locked on you can rotate the cam manualy with the arrow keys. I also did other small improvements to the engines drawing system such as now the buildings and floors now have a parent object that does the drawing instead of the buildings that way you dont have to keep copying the code to different buildings or floors you just attach it to the parent.
Heres the flowchart for parents
o_solid (used for colisions)[link object parent to this only if you want the character to stop moving when he hits the object]
|
o_parent_object (used to save code)[link object to this]
|
object (object it self)

Fixed hud glitch.. again lolz
replace the hud drawing code with this
{
d3d_set_lighting(false)
d3d_set_projection_ortho(0,0,1024,768,0)
d3d_set_hidden(false)
draw_set_alpha(.4)
draw_set_color(c_gray)
draw_rectangle(0,0,24,36,0)
draw_set_alpha(1)
draw_set_color(c_black)
draw_text(0,0,oCAM.target.zz)
draw_text(0,16,fps)
d3d_set_hidden(true)
d3d_set_lighting(true)
draw_set_color(c_white)
}

Please Leave a comment with your thoughts ^after all, how am I supposed to know what to and what not to add?
Features so far
  • Auto tileing building textures(Includes roofs and walls
  • Bigger character sprite(makes him look less pixelated)
  • Car box has collision now
  • Now you can't leave the room boundary MWA HA HA lol(except the car seems to some how defy that o.O)
  • Easy to control camera object(zoomz,rotates and locks angle on play when you press"C" key)

Features I'm working on
  • Auto-Tileing floors (auto tile roads are 45%done)
  • custom save system (I'm using ini files not GMs standard save feature, so far the cars and the player both know where I left them and weather or not I'm in the darn car and it knows which car I'm in ^^)
  • Weapons System
  • Enemies
  • Customizable Controls
  • Pause menu system (This sends the player to a room called pause_room. now i know what ur thinking, wont that cause the game to forget where every thing is? NOPE it wont ;) I made it so the game makes a temporary save file remembering where things are then deletes it at the end of the actual game)
  • day night system(currently the engine can do right now is raise and lower them look in the lights code for those controlls)

So far I've spent an accumulative of 3days on this engine >.<, plz give credit if used and don't use my character sprite I'm using him in one of my games. heres a screen shot of the engine enjoy B-) -

Posted Image

Edited by slkjdfv, 17 January 2010 - 07:31 AM.

  • 1

#2 RocketLauncher3G

RocketLauncher3G

    Int. Game Programmer

  • GMC Member
  • 627 posts

Posted 15 January 2010 - 09:00 PM

Nice example!

And... I could leave the boundary! muahahaha (in the car box :P)

it worked fast!

-RL3G

My only complaint is the movement speed :P A little bit too slow :P

But... this uses 3d... I thought ... nvm... There are examples which uses fake3D :P I think those are a little faster and better, hey... Good job!

Edited by RocketLauncher3G, 15 January 2010 - 09:04 PM.

  • 0

#3 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 15 January 2010 - 10:03 PM

Nice example!

And... I could leave the boundary! muahahaha (in the car box :P)

it worked fast!

-RL3G

My only complaint is the movement speed :P A little bit too slow :P

But... this uses 3d... I thought ... nvm... There are examples which uses fake3D :P I think those are a little faster and better, hey... Good job!


the fake 3D examples are faster but only by so much and also w3d engine is in my opinion is the best fake 3D one BUT, to many fake 3D objects in one area can cause lag this doesn't happen in my game well I havn't seen it yet :P. Also if you notice in my engine the buildings only draw walls that can be seen. so less polys are drawn saving cpu. The fake 3D engines also cant texture the walls right they look zig zagy. and my game does use 3D, the character is 2D and so is the Vehicle. I drew those using d3d_draw_floor. ^^. I use 2D characters and such cause I cant model no do I have a clue how to animate it lolz
  • 0

#4 Symbols

Symbols

    GMC Member

  • New Member
  • 343 posts

Posted 15 January 2010 - 11:50 PM

Thats very cool, and useable.... :P nice
  • 0

#5 MGUNIT

MGUNIT

    GMC Member

  • GMC Member
  • 534 posts
  • Version:GM:Studio

Posted 20 January 2010 - 05:51 AM

Thats a really nice example. Just a quick question. I have a tds and want to add 3d walls, rocks and trees to it. how do I use your example to do that?
  • 0

#6 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 20 January 2010 - 06:23 AM

well if you notice all you do is create the object lets say a wall, in the create event set what the texture is. next in the draw event just use d3d_draw_wall(x1,y1,z1,x2,y2,z2,all the other stuff :(). now if you want the character to collide with this wall you just attach it to the o_solid parent and all done. walls are my next addition I'm adding as well. now for objects like trees its the same thing mostly if its a 3D tree you modeld, you create the tree object, in the create even load the model set the texture. in the draw even you just tell the program to draw the object now set the parent to o_solid and all done. When I can I'll add that to the tutorial. I'm working on the cars right now then the walls then the 3d objects :D. Look in the 3d tutorial forum for more info on loading 3d objects. I use 2D stuff cause it takes up less memory. well i use 2d sprites and for trees, ^^. any ways in my next update there will be lots more and I'm trying to comment more I realize i don't do it enough lol :D
  • 0

#7 PlasticineGuy

PlasticineGuy

    GMC Member

  • New Member
  • 2384 posts

Posted 20 January 2010 - 06:59 AM

You animate models by loading each frame separately and storing them in an array. You basically have to emulate Game Maker's sprite animation; you have some kind of model_index and model_speed (as well as model_number equalling the number of frames), and in each step you increase model_index by model_speed. You ensure that when model_index reaches model_number, you reset it to 0. Then you simply draw the model at model[floor(model_index)] where model is the frame array.
  • 0

#8 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 20 January 2010 - 12:08 PM

Is that relly how you do it? kewl, sounds similar to what im doing to animate the 2d player :D. See i've never worked with 3d model animation b4 :( thank you for the post thats very helpful :D
  • 0

#9 MGUNIT

MGUNIT

    GMC Member

  • GMC Member
  • 534 posts
  • Version:GM:Studio

Posted 20 January 2010 - 12:31 PM

Slkjdfv, is there a chance I can give you my tds (its pretty small) gmk and try add a 3d wall?
  • 0

#10 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 20 January 2010 - 12:49 PM

Slkjdfv, is there a chance I can give you my tds (its pretty small) gmk and try add a 3d wall?

sure but are you using 3d or 2d?

if its 2d look for W3D engine int the tutorial section ^^, tthats a really great fake 3d engine, the only issue i see with fake 3D is that it doesn't texture correctly.
  • 0

#11 MGUNIT

MGUNIT

    GMC Member

  • GMC Member
  • 534 posts
  • Version:GM:Studio

Posted 20 January 2010 - 04:52 PM

We pmed each other
  • 0

#12 videogameaddict13

videogameaddict13

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 26 March 2012 - 04:19 AM

i'm sorry. you probably already stated how to do this but i didn't get it. when i put down a building, all i see is the roof. how can i make the walls? nice engine btw. :skull:

Edited by videogameaddict13, 26 March 2012 - 04:20 AM.

  • 0

#13 slkjdfv

slkjdfv

    GMC Member

  • GMC Member
  • 53 posts
  • Version:GM8

Posted 26 March 2012 - 09:18 PM

Are you using the pre-made building or did you create a new building object?
  • 0

#14 ccook525

ccook525

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 06 April 2012 - 01:14 PM

OK
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users