[On hold indefinitely] Full 3D in RMXP

UPDATE - 5/5/09
Ok, here's a small update. This is a quick little example of lighting. As you can see, there are some problems I have to work out with the lighting on tiles.

screenshot Show
Image


Demo: Link

Don't Forget:
I still need help with art and with moral support!
Please contact me if you are a 3D artist.
If you want to offer moral support, keep posting!



Old Releases:

Fourth Release - Prelim Mapping Show
Alright guys, big goings-on. I can now successfully make 3D maps using the 2D map editor! Now, this time around it is pretty simple-- all tiles are simply cubes and the id of the tile determines which texture the cube gets. This, however, proves the validity of using RMXP to make 3D games.

Now, not only is drawing these 2D maps in 3D with my tool possible, it is also, so far, much much faster than drawing the maps in 2D using RGSS Graphics Module. In fact, during my testing I get 250+ frames per second.

Alright, so enough talk. Let's get to the awesome: *BIG Image Warning*
Image

Image

Image

Image

Now, the RGSS code running the demo: (No explanatory comments this time, guys :p)
  1.  
  2.   DF_GameWindow.set_dimensions(0,0,0,0)
  3.   device = DF3DDevice.new(Video::EDT_DIRECT3D9, [800,600], 32, false)
  4.   smgr = device.scene_manager
  5.   driver = device.video_driver
  6.   camera = smgr.add_camera_scene_node_FPS
  7.   camera.set_position(-100,300,-100)
  8.   camera.set_target(0,0,0)
  9.   $data_tilesets      = load_data("Data/Tilesets.rxdata")
  10.   $data_common_events = load_data("Data/CommonEvents.rxdata")
  11.   $game_map = Game_Map.new
  12.   $game_map.setup(1)
  13.  
  14.   for i in 0...20
  15.     for j in 0...15
  16.       for k in 0...3
  17.         if $game_map.data[i,j,k] != 0
  18.           node = smgr.add_cube_scene_node(64)
  19.           node.set_position(i * 64, k * 64, j * 64)
  20.           node.set_material_flag(Video::EMF_LIGHTING, false)
  21.           texture_name = ($game_map.data[i,j,k] - 383).to_s + ".png"
  22.           node.set_material_texture(0, driver.get_texture(texture_name))
  23.         end
  24.       end
  25.     end
  26.   end
  27.  
  28.        
  29.  
  30.   lasttime = Time.now
  31.   while device.run
  32.     DF_Input.update
  33.    
  34.     if DF_Input.trigger?(DF_Input::KEY_F)
  35.       p driver.get_fps
  36.     end
  37.    
  38.     time = Time.now
  39.     if time - lasttime > 5
  40.       Graphics.update
  41.       lasttime = Time.now
  42.     end
  43.     driver.begin_scene(true, true, [255, 160, 160, 255])
  44.     smgr.draw_all
  45.     driver.end_scene
  46.   end
  47.  
  48.   device.drop
  49.  
Expand to see the code.


And, of course, there's a demo to be had!
Keys:
Arrow Keys to move (for now. I will change it later so you can use WASD)
F to show FPS
CTRL + F4 to quit

Link: Download Now!


Third Release (RGSS Controls the 3D) Show
Alright guys, now it's time to show you something really cool. I don't have a demo, but instead I have a screen shot and some real RGSS code to do with it.

Image

And here is the magical RGSS code that does it. (Normally, you would put this in a scene, but you guys know how to make scenes so I didn't bother)

  1.  #First, let's move the 2D window out of the way:
  2.   DF_GameWindow.set_dimensions(0,0,0,0)
  3.   #next, let's create out device. The parameters are:
  4.   #Driver type, screen size (in an array), bits per pixel, and fullscreen
  5.   #This device is the central point of the 3D engine. Absolutely everything
  6.   #can be accessed through this device.
  7.   device = DF3DDevice.new(Video::EDT_DIRECT3D9, [800,600], 32, false)
  8.   #Now, let's get our scene manager. The scene manager does stuff like adding nodes
  9.   #and cameras
  10.   smgr = device.scene_manager
  11.   #Now, let's get our driver. The driver handles actually rendering.
  12.   driver = device.video_driver
  13.   #Let's get our mesh! (Note that you should probably add error handling here.
  14.   #smgr.get_mesh will return nil if it can't find the file so make sure you
  15.   #always check that the mesh was actually created. I didn't do any error handling
  16.   #but a simple check for nil would suffice)
  17.   mesh = smgr.get_mesh("sydney.md2")
  18.   #Let's create an animated scene node from the mesh. Again, normally you
  19.   #want to check for errors.
  20.   node = smgr.add_animated_mesh_scene_node(mesh)
  21.   #now, let's add a camera to the scene node! Camera are how you view everything
  22.   #in the scene. Note that it is possible to have more than one camera and
  23.   #you can switch between them, or even have them render to different parts
  24.   #of the screen.
  25.   camera = smgr.add_camera_scene_node
  26.   #move our camera, since both the camera and scene node are at the same, default
  27.   #position right now. (Which is (0,0,0)) Note that the parameters here are x, y, z.
  28.   #when your camera is at (0,0,0) and has no rotation, x is sideways, y is up,
  29.   #and z is forwards/backwards
  30.   camera.set_position(100,100,100)
  31.   #Rememeber how I said that the default position is 0,0,0? Well, since we never moved
  32.   #our node, it is at 0,0,0 right now. So, Let's tell the camera to look there:
  33.   camera.set_target(0,0,0)
  34.  
  35.   lasttime = Time.now
  36.   while device.run #check if our device is still running
  37.     #begin rendering the scene. I will not explain what these parameters are yet
  38.     #it's not important right now, and it's kind of complicated XD
  39.     driver.begin_scene(true, true, [255, 160, 160, 255])
  40.     smgr.draw_all #draw all of the scene nodes
  41.     driver.end_scene #finish rendering the scene
  42.     #this junk is just so Graphics doesn't whine.
  43.     time = Time.now
  44.     if time - lasttime > 5
  45.       Graphics.update
  46.     end
  47.   end
  48.  
  49.   #Now, alway always always remember to drop your device when you are done.
  50.   #The device is something you should only drop at the end of your game, after
  51.   #the device no longer runs.
  52.   device.drop
Expand to see the code.




Second Release (First look at game logic) Show
Hey guys! I just finished a new demo! This one allows you to actually walk around, so you guys can see that this is actually practical for making a game, and not just taking screenshots. You can also choose which renderer to use. Note that the 2 software renderers are very slow, and D3D8 does not work at all. OpenGL or D3D9 are your best bet.

I will post the RGSS code tomorrow, so you can see what it is like, but I am out of time.

Alright, first a screenshot. ON this screenshot I only took a picture of the 3D window, since you guys know it is actually RMXP (vgvgf can vouch for me, since he actually decrypted the project and looked XD)

Image

And the new demo can be downlaoded here:
3D RMXP Walking Demo

KEYS:
Arrow keys to walk
Mouse to look
F to print current FPS (Please tell me what you get)
Ctrl+F4 to quit (not alt, note that alt is disabled while running this)


First Release (3D Rendering) Show
Image

Do I have it now? Good. That is exactly what it looks like: a 3D program running from RMXP. (I will explain why there are two windows, the little one and the big one*)

Don't believe me? Try it yourself:
RMXP in 3D Demo
Pfffft.

*MY* 3D is waaaaaay better. ;P :devil:


I don't know what I can offer besides moral support. This is tres cool. It's actually gobsmacking really.
I've downloaded the demo, and I'll try it later. But, this does look very impressive (I tried the older demo not too long ago), and a quick suggestion: Do not use the mouse for rotation *ever*. It disables the closing of the window, and makes it very hard to steer.

A couple of features/requests.

- Keyboard Config that doesn't affect other rmxp games, very important to me!

- Would it be possible to make it work with the XAS Action RPG system, without
much editting? The surefire way for me to port my game to this system ^^

- First Person View, man! I'd love to port my FPS system to this. (I'm using Behemoth's Raycasted Tilemap script at the moment)
Thanks for the comments guys, keep them coming.

@Incognitus: You can't contend man, you can't contend :D


@Near:

-What do you mean by the first one? You mean making it so changing the keyboard config in one game does not change the others? Well, for me, that one is a-given :D. This 3D stuff will include my Advanced Input Script and Custom Resolution Script that I made a couple days ago. Most of the annoying stuff like that will be fixed here.

-Well, I am planning on making a 3D battle system to go with it, so it will probably not work with XAS *by default*. However, it will be possible for you to make a couple minor edits to put XAS instead (But the XAS would be 2D, like it is right now)

-Yeah, first person view will definitely be an option by default. You can choose 1st or 3rd person.

As for the mouse rotation, in a 3D game you generally do not use the mouse to close a window, you use alt+f4 or navigate the menus. For older demo, it was the former. The problem making it hard to steer was a matter of fine tuning some settings, which I had not done.
Is the system in Ruby? I guess not, but if it is, how well does it perform?

How are models managed? I mean, file format, editor (blender/maya/3DS)...
The majority of this project will be C++ functions called by RUby through external DLLs. The currently supported model files are:
Current Supported Model Formats Show
* Irrlicht scenes (.irr, r/w)
* Irrlicht static meshes (.irrmesh, r/w)
* 3D Studio meshes (.3ds, r)
* B3D files (.b3d, r)
* Alias Wavefront Maya (.obj, r/w)
* Lightwave Objects (.lwo, r)
* COLLADA 1.4 (.xml, .dae, r/w)
* Microsoft DirectX (.x, r) (binary & text)
* Milkshape (.ms3d, r)
* OGRE meshes (.mesh, r)
* My3DTools 3 (.my3D, r)
* Pulsar LMTools (.lmts, r)
* Quake 3 levels (.bsp, r)
* Quake 2 models (.md2, r)
* Quake 3 models (.md3, r)
* DeleD (.dmf, r)
* FSRad oct (.oct, r)
* Cartography shop 4 (.csm, r)
* STL 3D files (.stl, r/w)


So, to sum up, my code is in C++, but you will be able to use it with Ruby.
Ah, thanks.

My first question was about the key config, and how the usual F1 method made it different for every rm game you played.

Also, what kind of battle system? I liked the Golden Sun battle system myself. But if it will be an ABS kind of system, I'm all good.
Probably very similar to the default RMXP battle system. For the most part I will just be converting default scripts to 3D to give an example of how to use the 3D API. You guys will get to look at my scripts and be able to make your own stuff :D.

Actually, the more I think about it the more I think it will probably be some sort of animated battle. Not sure exactly what yet. By the way, Near, how did the demo run for you?
Not good.

Script 'DF_SystemTools' line 28 : RuntimeError
Load Library: DFRMTools

There is a 'DFRMTools.dll', but I don't know whats messing it up.
Well it runs pretty fine for me, no problems whatsoever, saying that, my computer is pretty much the god of all specifications, lol, as for the battle system, if it's going to be animated, perhaps you could take a look at having it similar to Final Fantasy X, and maybe if you're tricky, you could get the dynamic cameras, so the camera follows the attacker, lol.

This seems like a really interesting project, and I'd love to try it out when a usable release is, well, released. Although I am pretty sorry that I can only offer my support, as I have absolutely no experience with 3D modelling.

Hope all goes well while making it, and I look forward to seeing results ! :thumb:
If DFRM tools is messing up I think it means I included the wrong MFC. I will try to fix that.

@jbrist: thanks for the comments! Your moral support will be greatly appreciated, just keep churning out suggestions XD

As for the FFX battle system, I hated that battle system with a passion XD Sorry XD


So guys, tomorrow I hope to have a demo where you can walk around and junk, ok? Keep the comments coming!

Also, don't forget, I need some models still!
DeM0nFiRe wrote:
If DFRM tools is messing up I think it means I included the wrong MFC. I will try to fix that.

@jbrist: thanks for the comments! Your moral support will be greatly appreciated, just keep churning out suggestions XD

As for the FFX battle system, I hated that battle system with a passion XD Sorry XD


So guys, tomorrow I hope to have a demo where you can walk around and junk, ok? Keep the comments coming!

Also, don't forget, I need some models still!


:o: , You're the first person to ever tell me that you hated the FFX battlesystem, everyone else I know who's played it loved the battlesystem, lol.

Hmm, although it may be tricky to set up where the characters move, maybe you could go for a Chrono Trigger approach to the battlesystem ? I mean, it'd be great if it could be implemented, but making sure that when you encounter an enemy, your characters don't do something dumb and run over a tree could provide difficult, unless I'm completely wrong and it's something easy, lol.

Or how about going for a different approach to the battlesystem, obviously it'd be turnbased as most RPG's are, however;
You see your character from directly behind, slightly overhead so you can see the enemies directly ahead of you, and when you attack/cast skill etc., the camera angle changes to behind and slightly overhead of the enemy, so you see your character running/walking/crawling/rolling towards them and hit them, it may be something worth experimenting with...

And ooh, a moving demo, that could provide useful, as people will be able to see the playability in this and see that it's not just a fancy visual, but infact a fully working moving game.
I do need to learn some 3D modeling... i'll give it a try, when i get my good comp fixed.
Sorry, but it could take another 2-3 weeks...
Yeah, good discussion on the battle system, keep the ideas coming. I think you have convinced me to not just remake the default battle system. Not sure I like the ideas so far, though. I think you are assuming this is harder than it is. Once I have the 3D API working, the rest won't be too hard at all.

And yeah, I think a walking demo will spark some more interest and prove that this is real.

@Near, can you please try this: http://www.box.net/shared/37l6qh7cc5

Thanks guys!
Same error. It could be my comp maybe??? I am stuck using my old Gateway 1990 something computer.
You should change to RMVX. RMVX doesn't need Graphics.update to be called between some time, it's better that way, no HangUp error.

Also, it don't works for me. It throws me an "Game.exe has detected an error and have to close." message window. I'm using WinXP SP3 and RMXP 1.02E. Nice project, anyway, keep working on it.
@Near: Hmm, I will keep looking for possible solution to your problem.

@vgvgf: Well, I am doing it in RMXP just because I started learning object oriented programming in Ruby through RMXP. Seeing as this is like my farewell to RM, I thought it was fitting. I will probably port this to RMVX later.

As for your error, I think that was an upload error, let me reupload it...

Ok, try redownloading it.
Redownloaded, extracted, and still doesn't work. Maybe I need to have something installed that I haven't, a programming error, or else I don't know.
Can't be a normal programming error. I mean, it must be in some way, but not like a normal error. I'll have to look at it to see if I am missing anything. I have an idea of what it may be. You have SP3, right? I think SP3 introduces some memory security that would get in my way. I need someone else with SP3 to test it as well.
i downloaded it and it worked prefect for me, i have vista fully updated if that helps any, i also have build 7000 of windows 7 and it works on that too
The error shows up when:
  1. START3D_FUNC.call
Expand to see the code.

is called.

I have deactivated some windows services in my pc, may that be interferring? Or maybe I haven't some dll, does your dlls call some extra non common dll?
Well, thanks a shitload for decrypting the project that I encrypted :P
I mean, it's not a big deal since the only real reason I encrypted it is because it is not clean enough for people to use yet, but don't you think when someone encrypts a project it is for a reason? I was under the impression you guys were only using that things to recover files from projects of long lost people.

Anyway, yeah, do you have DIrectX9 *fully* supported on your machine? Also, can you please give me a list of all the dlls in that folder?

@deathbecoast: Thanks for testing it out. I think it's funny that this has worked on more Vista installations than XP installations XD
Hey Demonfire, can you show us some demo actually made with RMXP editor? I'm really curious how it works. Also, did you test the performance of the engine? If it's not a problem I'd like to know about polycount limits per object/scene, textures resolution, some features (bump/normal mapping, specular highlights, z-buffer, texture filtering, etc.) - sorry for all this, I'm not to familiar with Irlicht. I think I could provide you with some objects to work with (as soon as I finish scripting for TM ;))

p.s. In the window it says Irlicht software renderer. Isn't it hardware accelerated?
Yes, sorry about that text. This demo was actually taken from an Irrlicht tutorial, which originally used software render. I just didn't change that text, but it is hardware accelerated through Direct3D9. As a matter of fact, my next demo will show how you can pick from 5 different rendering APIs.

The performance of Irrlicht is very good. I've actually been using it for several months, now. It is a really great engine. I can provide you with a full list of features eventually, but for right now I will just give you a few examples:

-Bump Mapping
-Parallax Occlusion Mapping
-Animated Meshes (You saw that already)
-Basic Collision Detection (If we decide we need more, I will integrate Bullet or Physx)
-Multiple viewports (IE, if you wanted to do a split screen multiplayer game, it is as simple as creating 2 cameras and rendering them to separate viewports)
-Automatic Terrain Generation (based on greyscale height maps.)
-Bilinear, Trilinear, and Anisitropic Filtering
-5 different rendering APIs: D3D8, D3D9, OGL 1.2 - 3.0, Irrlicht Software, Burning's Video Software
-Full support for Pixel and Vertex Shaders

In terms of poly limitations, texture resolution etc, I believe the only limitations are on the hardware, and the fact that it is 32 bit, and not 64 bit.

The Irrlicht Engine is not what you would call a toy engine XD It's a serious engine, for sure. The only real limitations will be in terms of how much of it I actually export for use with RMXP. The more interest you guys put into this, the more I will get working for you :) I will be providing high level functions, so you won't have quite as much control as if you were just using Irrlicht. However, for a scripter like yourself, there will be a whole lot you will be able to do with it.

Right now I am working on a demo that will show you how you can walk around, to show you that this is actually practical for making a game and not just fancy screenshots ;) As for making a demo that was made using the RMXP editor, that will come closer towards the end. I need to export the functions and I need art before I can do that! This next demo will also be made using RGSS coding for as much as possible. (This first demo I showed you used RGSS very little and for the most part RGSS just called a couple functions to start the C++ code)
Although this looks like some awesome work here, I also get the

Script 'DF_SystemTools' line 28 : RuntimeError
Load Library: DFRMTools

Error. AND I have the fully updated version of Vista. Wierd.
If DFRM tools is having a problem, that means I am not including the right DLLs for MFC and MSVC. I will try to figure out which ones I have to include. Can you please tell me what DLLs are in the game folder now?
Looks amazing. I wish you good luck with this.
I was going to suggest you to convert to VX, But you already thought of that :P
Haha, yeah, I will definitely provide a version of the 3D API for both. I don't know for sure if I will provide a set of working scenes and such for VX or not.
Wow - you have my moral support :thumb:
Would definitely use, but I'm not sure how the editor would work.
- Sits back and waits - 😀 :grin: :dead:

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=64022