Author Topic: Raycaster map through new lib  (Read 11407 times)

Mopz

  • Guest
Raycaster map through new lib
« on: July 03, 2014, 10:34:35 AM »


I'm working on a 3d library for naalaa 6 based on one of my old game engines. I wrote a loader for maps created with naalaa's raycaster editor and after running some pull functions on the floor and ceiling it already looks kind of cool. The engine DO support non-orthogonal walls, but since this is a raycaster map you don't see it here.

I've attached the example, but you need naalaa 6 to compile and run it.


Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #1 on: July 03, 2014, 02:46:11 PM »
Yes, I record everything: http://youtu.be/wM3mGohetfw

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Raycaster map through new lib
« Reply #2 on: July 03, 2014, 07:57:02 PM »
Great. But could the spinning around be stopped if one moves the mouse to the right or to the left?
And is it possible to toggle the library to fullscreen?
« Last Edit: July 04, 2014, 07:08:01 PM by Cybermonkey »

Guilect

  • Guest
Re: Raycaster map through new lib
« Reply #3 on: July 04, 2014, 08:35:45 PM »
Looking good Mopz.

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #4 on: July 13, 2014, 01:32:57 PM »
I posted something yesterday night that didn't work at all (hardcoded paths). But the TD library and editor are soon finished. Here's a rather blocky example. Only mouse control this time: move and turn with arrow keys, look up and down with PgUp and PgDown.

Textures from opengameart.org.

I need to add support for water and change of lighting so that you can make parts of a map more gloomy. Also, you can't add models to your map yet (that's why things look blocky, only walls, floor, ceiling and heightmap are used).
« Last Edit: July 13, 2014, 01:46:15 PM by Mopz »

Guilect

  • Guest
Re: Raycaster map through new lib
« Reply #5 on: July 13, 2014, 03:15:51 PM »
Hi Mopz,

Your demos keep getting better and better.

I agree with Cybermonkey regarding the motion when turning; it makes me a bit sea sick.

In looking at the sourcecode for the example, it is cool to see how little code is required.
Just load a map and add some controls for player movement.
I am curious how you modified the rc editor to allow for height.
I liked the spiral ramp in the demo map.
Being able to place lights would be a great addition.
What type of models and or billboards do you hope to support?

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Raycaster map through new lib
« Reply #6 on: July 13, 2014, 03:41:41 PM »
Hm, I just thought if it might be possible to port that library to Pascal. You are only using default OpenGL/freeglut functions?

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #7 on: July 13, 2014, 05:29:58 PM »
Hi Mopz,

Your demos keep getting better and better.

I agree with Cybermonkey regarding the motion when turning; it makes me a bit sea sick.

In looking at the sourcecode for the example, it is cool to see how little code is required.
Just load a map and add some controls for player movement.
I am curious how you modified the rc editor to allow for height.
I liked the spiral ramp in the demo map.
Being able to place lights would be a great addition.
What type of models and or billboards do you hope to support?

Thanks :) I've been sick for a couple of days, so there's not much else to do than to stay in bed and try to program. Probably back to work tomorrow.

The raycaster editor is not used anymore, but you can import such maps. I've written a new editor (see attached image) where you edit while running around :) I precalculate all lighting, so that the map can be rendered fast. So you'll be able to add light and darkness in some way. I've written loaders for my own mesh format and will include an old modelling program for generating those. Other than that I think I'll just go with OBJ for static things in the map and MD2 for characters. What do you mean with "billboards" in this case? For me, a "billboard" is just an image always turned in the player's direction :)
 
« Last Edit: July 13, 2014, 05:37:17 PM by Mopz »

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #8 on: July 13, 2014, 05:35:10 PM »
Hm, I just thought if it might be possible to port that library to Pascal. You are only using default OpenGL/freeglut functions?

Yes, if you look at TD.txt most calls starting with _gl end up as normal OpenGL calls in the end. So most of it you can probably just move to pascal. But they go through a naalaa extension, gl_next. If necessary I or John will uppdate the c-part of the extension later to a less ancient OpenGL version.
« Last Edit: July 13, 2014, 05:38:21 PM by Mopz »

Guilect

  • Guest
Re: Raycaster map through new lib
« Reply #9 on: July 13, 2014, 09:20:57 PM »
@Mopz,

Hope you feel better.
I like the idea of walking around and making the level.
For billboards, I guess I just meant 2d sprites in general.
They would be good for HUD's, text, and such things.

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #10 on: July 14, 2014, 06:20:17 AM »
@Mopz,

Hope you feel better.
I like the idea of walking around and making the level.
For billboards, I guess I just meant 2d sprites in general.
They would be good for HUD's, text, and such things.

Ok, then I get it. And, of course, they are important in this case. The extension overrides the naalaa window, so you still get keyboard and mouse input, but normal drawing doesn't work. There'll be commands like TD_DrawImage and TD_DrawString for 2D drawing.

Code: [Select]
rem Render map without flush.
proc TD_Render false
rem Switch to 2D.
proc TD_Make2D
proc TD_DrawImage MY_IMAGE, 200, 100
proc TD_Redraw

All drawing is already cached because of how OpenGL works.

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #11 on: July 14, 2014, 10:32:31 AM »
I added support for MD2 models and modified the attached example so that you run around with Blade  ;D


Guilect

  • Guest
Re: Raycaster map through new lib
« Reply #12 on: July 14, 2014, 11:07:16 PM »
I must be doing something wrong.  :P
Your latest (td_example2) demo does not run for me.

I get "Line 1: Missing DLL function"
I can run the previous demo (td_example) fine.

Windows XP Service Pack 3

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #13 on: July 15, 2014, 05:33:36 AM »
I must have forgot to put the latest version of gl_next.dll in the folder. Never mind, it was not that much of a difference compared to the other test.

I've tested many md2 models, and I must say it's a shame there's no standard at all when it comes to indexing the key frames. You always have to figure out which sequence of frames are for walking etc. Other than that I really like this old file format - I had never used it before. Do you know if people use (used) it only for animated objects or also for their static stuff?

Mopz

  • Guest
Re: Raycaster map through new lib
« Reply #14 on: July 15, 2014, 03:32:18 PM »
Weird. Downloaded it on a clean computer, and it ran fine with the included gl_next.dll. The messagebox is generated by naalaa, that I know since I wrote that part myself. But I'll ask John to add some more info like dll- and function name.