Online Multiplayer 3D ( was: Ludum Dare 47 : Sial = Get stuck with your friends)

mdotedot

  • Posts: 1654
After 12 hours I am ready for a break. I didn't got any sleep over 34 hours :D

Theme : Stuck in a Loop

What I'm going for is that you are stuck with your friends. There should be zombies and vampires.
Vampires come out at night and the zombies during the daytime.
You are in a cemetery and when you think you reach the end it will LOOP you back.


Tools:
  • Gimp
  • MagicaVoxel
  • MixaMo
  • Noesis
  • Colyseus Extension
  • Away3D Extension

Done:
  • Room Lock template adaption
  • Healthbar behavior
  • Random wall generator
  • Searching free spot
  • HIT - detection. Currently on friends : To be converted into monsters-only (More emphasis on Co-Op)
  • PointLight mechanism so that you can help your friends spot enemies

ToDo:
  • Enemies
  • Spawning and fighting mechanism for the enemies
  • Day/Night cycle
  • Limit room for 4 players and offer creation of room for others
  • Loop-back implementation
  • Menus / SplashScreen

Progression with three active sessions:



Game:
http://photoquesting.com/ludumdare/47/part1/index.html




« Last Edit: October 07, 2020, 11:39:33 am by mdotedot »
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654

After 25 hours I'm ready for another break.

I can't seem to find what is cause of these bugs:

* Sometimes the graves are not generated. So you can't walk on a path that looks like it is there
* Vampire and Zombies are messing up with the players movement. I now have them (temporarily) removed and there is no interference with MD2s taking over

The day/night system took way too long. But it was important to get the loop-fealing : that you are there forever ...

What I know about:
* Day/Night cycle is not synchronized : I need to use ServerTime and not the 'every' x on each client
* Day/Night is now very fast : it is for debugging purposes

Done:
* Day/Night cycle & pointlight mechanism
* Assets: graveyards, gate, tree
* Animations for the players, vampires and zombies
* Loading and displaying assets and animations


ToDo:
* Fix animation issues with Zombies and Vampires
* Work on the hit-mechanism for Zombies and Vampires
* Fix the Gate (where is it ???) Propably one of the paths that I can't move to
* Idle animations
* Other animations like attack / falling etc..
* LoopBack mechanism for both kill and victory
* make healthbar smaller
* limit room
* start screen
* Level Design.Just one level and you should not random initialize it.


Progress:

Current state: http://photoquesting.com/ludumdare/47/part2/index.html






Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
It has been 35 hours now.

Scope is everything. So I cut down the graveyard. It is now 'just' some zombies and vampires.

The MD2 animation was caused that a later load of a MD2 overwrote another MD2.
To solve this issue I use a boolean when a MD2 load is done and only when there is no other MD2 loading another one can be loaded.

This slows down startup/load of the game unfortunately. Not sure how this will perform when the enemies are created dynamically.
Maybe I need to cut down the possible enemies on the screen. We will see.

TODO:
* Day/Night cycle based on servertime
* enemy spawning and kill system
* Gate : loopback system
* Kill / loop animations
* Idle and attack animations
* Level design
* Intro/Start screen



Progress:

Current state: http://photoquesting.com/ludumdare/47/part3/index.html






Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
End of COMPO time and I don't have it ready.
At 21:00 I thought that I could make it. But what I suspected: The dynamic load of the animations is taking a toll on the experience.

Tomorrow I try to work on pre-loading the stuff and re-using enemies that are killed off....

I did manage to make a better starting screen  than the green empty one    :D   






Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
After some hours debugging I found that HTML5 memory consumption is really the issue.
Windows executable is far better.

This is propably due to this issue:  http://community.stencyl.com/index.php?issue=1532.0

For Stencyl assets I can avoid using the draw routine. But Away3D uses draw routines as well.
I tried to work-out in what part it relies but time is running out and I need to do other things.
So I might be publishing to Windows / Android instead of HTML5.




And with 10 actors:




Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
This was not a good day.

Refactored twice to get better resource loading. Also on Windows build things got crazy!
So these bugs aren't a result of HTML5.



I tried to pre-load stuff and to optimize for switching animations.
It turned out PINK !!!


When I copy the original code from the original behavior to the new behavior and call the old code
it works!!
After four hours of finding the differences between the two code blocks I am really frustrated.

I could go back to the code from last night and try to hack a version for the entry together but
honestly I'm  not motivated to do that now.
Maybe another time.

So, again, for the xth time : I do not enter anything into LD!!!!!




BUT :

I did enjoy using Mixamo and MagicaVoxel for asset building.

Also the Colyseus Engine is handling things quite nicely. Apart from not always creating a room.
That was already some known bug but that I can't seem to find. It happens occasionally and those
are the most difficult bugs to track.

I will propably work on this another time. As always I want to learn things. So this is again
a nice thing to track down.

At least it worked fine with a couple of animations  :(  :)

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
Found the pink - bug!!!

In the Away3D engine I set a name of a material that has been loaded to:

'name of the asset'+'Material'  and the default material is a ColorMaterial!

While debugging my dynamic load code I found that I got a ColorMaterial back instead of the TextureMaterial.

In the stencyl code I dynamically created the animation like this:

Create [ [asset name] & Material ] type [ TextureMaterial ]

That is exactly the same as the default 'asset'+'Material'.

To prevent this mistake in the future I made the default name a bit more obscure in the Extension : MD2*Material

Now on to creating the objects on the fly using the pre-loaded data.

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Mineat

  • Posts: 376
I'm amazed at your progress in this project! For the HTML5 version, did
Code: [Select]
-D canvas help it at all?

mdotedot

  • Posts: 1654
Hi Mineat,

Thanks for reaching out.
-D canvas turns off 3D     :D     So it does not help at all   :D

Thanks for your kind words.

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
This evening I made some progress.

Turns out that the MD5 models take way less memory. Allthough the quality is slightly worse than the MD2 stuff.
But performance over quality in this case.

I still have to redo a lot of code on the ludum dare project, but made a proof of concept with 120 actors.

Random 12 animations on three different type of actors.  (the 3 actors have idle,run,walk and attack animations)

What you see here is that I move all 120 actors at the same time using the keyboard controls (4 way movement).
As well as moving the mouse on the Y-coordinate that zooms-in and out.
On the Left is the HTML5 version and on the right is the Windows version.


Do not confuse this output with previous images in this thread because those are multiplayer things. This is just showing the
performance and memory consumption of both versions running at the same time.


Maybe you can still see the number of memory consumption of these 120 actors??

Chrome consumes about 1 GB.
The windows version about 200MB.

I must say that the previous versions I had on the ludumdare did a load of the MD2 for EACH actor.
This method uses a preload of the assets and I found that I could CLONE the assets.
The LudumDare entry did load the assets FOR EACH actor and animation. I didn't know at that time that I could use
.clone on the animated meshes.

I did a quick test with the MD2 stuff but that didn't give me these drastic improvements as seen by the MD5 stuff.

This all seems way better to go forward and implement the same in the Ludum Dare entry. Because I did do something so differently it will take however a lot of changes to the current project to be on the same path as I left it on Monday  :D

But ... I have way more time; like a half year; before next Ludum Dare    HaHaHa


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654

Because I couldn't let the MD2 go, I made the same approach using the MD2 files.

This gives a bigger memory consumption:



More than 2GB on HTML5.

Strangely enough I couldn't get the Windows executable even load the 12 animations : MEMORY EXHAUST at runtime.

Also a run on Android crashed the game during the load of the MD2 files.


Running the MD5 on Android works OK!

Allthough the meshes are more cleanly on MD2 it is best to focus on MD5.

This leads to the conclusion that MD5 is the way forward.


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
Since I have more time now:  I started over and will propably change a few things so it does not rely on the LD47 theme.

Last week I've worked on a new 2D version of the network play. So there is a new demo on the colyseus page:

http://photoquesting.com/colyseus/

You can download the Colyseus extension and the .stencyl file to experiment on your own.

This week I'm going to try to add the 3D stuff with the Away3D Extension. (using the MD5 animation file format)

Current state:



Due to the smaller md5 format I can add more enemies on a larger scene but I'm not sure if I'm going for that at this time.


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654

Last week I've worked on the LudumDare entry.

I thought the animation system wouldn't be a problem but as always when you think that it is not a problem it becomes one.

Turns out that I'm not the only one : http://community.stencyl.com/index.php?topic=45985.0

Maybe merrak can show his technique in an upcoming dev blog :D :D :D


Anyhow, I hacked an animation manager. It isn't programmed, it is glue and sticks.




Play the game: http://photoquesting.com/ludumdare/47/part4

The source : http://photoquesting.com/ludumdare/47/md5_col_v88.stencyl


Maybe I will work on a propper animation system for future use, because I think I will need it again.


Now moving on to other multiplayer stuff.

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2738
Maybe merrak can show his technique in an upcoming dev blog :D :D :D

I like the idea :D But I'm going to need to get a working system first :o

I finally got to the point where the animation manager I'm using (the one I quickly threw together for Stencyl Jam 18) is getting too clunky to work with. I've started working on replacing it.

It's a big task, but not as bad as it could've been had I not gotten into the habit of writing modular code.