DIV ARENA FORUMS

Tutorial 7 Christmas Special

dom cook - 25-12-2016 at 12:48 AM



SNAP0001.PNG - 48kB

dom cook - 26-12-2016 at 08:32 PM

In the absence of a Christmas competition, This is my Festive offering
So far I've got:
A 3d Christmas tree.
A star that fires a laserbeam
Mouse aiming in 3d
Collisions using something akin to raycasting
Voxel (ahem) presents under the tree that I assure you look better in real life.

My idea is to put in a bunch of drones that will attempt to knick the pressies from under the tree, which will be able to fight them off by temporarily disabling them with its laser.
The game would be over when all the presents are gone or when the sun comes up and overwhelms the evil IR signals that are controlling the drones.

Any comments? (nice ones obviously)

Happy New Year Divvers.

SNAP0002.PNG - 15kB

dom cook - 28-12-2016 at 11:46 AM

Humbug it is then!
I can see I'm going to have to try harder to get a response

Check this screenshot. It illustrates a working search light.


SNAP0003.PNG - 15kB

MikeDX - 28-12-2016 at 12:38 PM

Sorry Dom I've had a crazy Christmas been traveling a lot and computer time limited somewhat.

I should have setup a Christmas compo.

What you've done there is really impressive! Going to try it on my new(ish) phone and see how well it runs!

BreadCaster - 29-12-2016 at 08:06 PM

the search light feature is cool, but i bet youve got like 5 other colours left in the pallete to use after rendering it x)

I remember back in the day there was a code snippet for mode 7 distance fogging floating around on the forums, god knows how it worked. Is that something you'd be able to replicate, dom? Could be useful if anyone wanted to make anything atmospheric. Just a thought =)

MikeDX - 29-12-2016 at 08:53 PM

Would you share the code and fpg with us Dom so we can have a play please? :)

dom cook - 29-12-2016 at 09:05 PM

Well I'm using 64 shades of grey and then 32 of each of the 6 primary colours.
You can check the palette if you're interested.
There are several techniques in this that I haven't tried before. I think some are pretty cool.

I was even toying with the idea of making a depth map so I've now basically figured that out in principle. That might be what you'd need for a fog effect but as I never saw the one you mentioned I don't know if that would be overkill.

Anyway thanks for the feedback boys.


By the way Mike I was thinking about implementing the snow into a DLL as a learning project so I tired to use the stars one you posted in the DLLs thread for guidance but, as usual I couldn't get it to work. I think I built it right but I just crashes DIV each time. Any suggestions?



SNAP0004.Png - 19kB



Attachment: yulewars.FPG (1.5MB)
This file has been downloaded 2453 times

[Edited on 29-12-2016 by dom cook]

Attachment: Yulewars13.PRG (27kB)
This file has been downloaded 2430 times


dom cook - 29-12-2016 at 09:14 PM

Oh yes, about the controls:
mouse to look around. Pitch and yaw, and rotate view if you yaw too far.
one of the mouse keys locks the yaw, enabling immediate rotation another one makes the tree drop a bauble.
if you hold down various combinations of keys _q _w _e you prime the death stars laser in one of 6 colours. Then mouse.left will fire it.
arrow keys steer the drone. (it's only got lights at the moment but will get a body next)

There are a bunch of presents lying around you can find them with the light.

MikeDX - 29-12-2016 at 09:22 PM

The stars DLL is probably not a great one to try with.

If you want to do something with DIV's framebuffer the ss0 and ss1 DLLs are good places to start, as they modify the pixel buffer directly.

Now to test this mode7 goodness

dom cook - 29-12-2016 at 10:40 PM

Quote: Originally posted by MikeDX  

Now to test this mode7 goodness


I hope you like it, I'm actually pretty proud of it. But you should try the reuploaded version (13) rather than the one you first downloaded (12).
There was something wrong with the way the snow moved a bit with the light. Anyway it's fixed now and looks a lot nicer (if you can believe that were possible).

MikeDX - 30-12-2016 at 12:51 PM

I think this demo is cool but highlights a problen with div when the mouse is trapped in the window.


CicTec - 31-12-2016 at 12:11 AM

Hi Dom,

Very nice tutorial.

Quote: Originally posted by dom cook  

By the way Mike I was thinking about implementing the snow into a DLL as a learning project so I tired to use the stars one you posted in the DLLs thread for guidance but, as usual I couldn't get it to work. I think I built it right but I just crashes DIV each time. Any suggestions?

The best solution is using the debugger, you need to compile the DLL in debug mode then launch the app with debugger so when it crashes should indicate at what point in the code.

dom cook - 1-1-2017 at 10:01 AM

Thanks CicTec. I had a few other ideas I wanted to put in but I'd given myself till today to see how far I could get. So further development will have to wait till next Christmas now.
Thanks for the tips on DLLS. Figuring them is my new year's resolution. I still don't know the first thing. For example how do you even compile a DLL in debug mode.


CicTec - 1-1-2017 at 10:49 AM

Ok no problem. :)

Assuming you are using GCC you have several options, the best way is to study a little bit of documentation and examples.

Here Several documentation link:
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
http://www.delorie.com/gnu/docs/gdb/gdb_17.html

http://stackoverflow.com/questions/10475040/gcc-g-vs-g3-gdb-...

Here, other tutorials and examples link:
http://www.seas.upenn.edu/cets/answers/gcc.html
http://www.rapidtables.com/code/linux/gcc/gcc-g.htm

If you have any difficulties, we are here to help.

dom cook - 1-1-2017 at 01:43 PM

Thanks again.
Now to find out what GCC is.