Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411196 Posts in 69314 Topics- by 58380 Members - Latest Member: feakk

March 18, 2024, 07:43:38 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSnake World - temp name - multiplayer snake with added biology
Pages: [1] 2 3
Print
Author Topic: Snake World - temp name - multiplayer snake with added biology  (Read 14939 times)
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« on: September 11, 2019, 02:11:55 AM »

Hi,

my current project is a Snake game: move around, eat stuff to grow longer, do not hit obstacles. Main course is open pvp multiplayer, although there will be a singleplayer / coop mode for feeding on the biology alone or with friends.

History:
I found https://slither.io one day, enjoyed it quite a bit, even got it for my phone. But its performance is really off-putting. It stutters or even pauses for a second even on potent gaming rigs. So a few friends from a small German IRC channel and me offhandedly decided to redo it "properly". And we wanted to add a lot of other game elements, too, so that it gets more laid-back and even allows to play alone / cooperatively. Then, one by one, they bailed from the project, so at the moment I'm doing it alone again.

Concept:
I know that slither.io has the comfortable advantage of being a browser game. I can't compete with that, but I can sure try to make it easily accessible by
a) using the Steam friends infrastructure
b) making it small to download, quick to install, quick to start playing

First aim is to provide an open multiplayer game like slither.io. I'll later add collectibles and cosmetics to be found in the game by which you can customize your snake. And if the game gets some traction, I'll also implement the Steam workshop stuff to allow people to add their own creations.

My current plan is to make the basic multiplayer game free to play on public servers. Then I'll try to earn a buck by a) selling the "personal" version which allows you to play alone and host private games for your friends and b) by selling special cosmetics.

Technology:
Of course if I complain about the drawbacks of web games, I better do deliver on the performance side. I'm using C++17/20 without an engine, based on my custom framework which grew with me over the last decades. Rendering is DirectX9 on Windows or OpenGL on Linux/OSX, sound is currently FModEx although I'm looking to replace it by something simpler and more license-friendly, plus Boost, AngelScript, freetype, GLFW, SNIIS, TinyXML, zlib, curl.

Current state:
I have a job and a family, so progress is moderate. Overall I invested maybe 50h of work over the course of 6 months. Basic gameplay is implemented and working, but unbalanced. You can run a dedicated server on Windows or Linux or localhost, join a server, spawn, move around, eat stuff and grow, sprint and spawn food, hit things, hurt/die and spawn food, respawn, chat, leave. Graphics are provisional upto now.

Images - click for full size





Graphics:
I have to admit that I really tried my best to do "real" graphics from the start. But even after all those years I'm terrible at doing gfx. I'll sure look out for an artist when the gameplay is round and fun.

As for an artstyle I'm aiming for a "microorganism life through a microscope" look. First was the PostProcessing seen above: vignette, blur, chromatic aberration in the corners. Next I put some tens of thousand of particles in the play field which get pushed around by any gameplay element. It doesn't exactly transport the "dirty water" feel I was aiming for, yet, but I'll surely revisit that later. I drew a test snake gfx, the zebra pattern makes it easier to spot mapping / shader errors. I also drew food bites, I was aiming for a "cell" look like a blob of water with a border, but failed miserably. So it's just colourful blobs for now.

next steps:

I'currently implementing walls. Nearly done with the collision part, next is a suitable look and then populating them with thousands of tiny plants that sway in the currents and if someone moves next to it. Then I'll probably go for the background which is too uniform right now. It needs some heavily blurred large scale elements slowly moving in the background to give the impression as if it's out of focus.

Timeline:

Nothing's planned out exactly, of course. After all this is just an hobby for now. I intend to have a private alpha on Steam at the end of the year so I can nail all the details in the Steam friend interactions. I hope to have some NPC content up then, too, but proper customization with some options to choose from will propably have to wait for next year.

Thanks for reading.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
oahda
Level 10
*****



View Profile
« Reply #1 on: September 26, 2019, 02:43:14 AM »

Looks cute! I haven't played slither.io but it brings back memories of playing Zatacka (AKA "Achtung, die Kurwe!") with classmates during recess.

Love the idea of making it look microscopic! Kiss If you're not aware of this relatively new YouTube channel, here's inspiration fodder galore:



Logged

Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #2 on: September 26, 2019, 03:18:36 AM »

Oh, great! I'm still collecting art style references and occasionally get lost in them because there's such a lot of cool stuff wiggling around underwater. Thanks a lot!
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #3 on: October 18, 2019, 11:03:20 AM »

Optimized and fixed a lot of things that came up in the first multiplayer test on a remote linux server. Gameplay loop is in a good state now, at least technically, so I moved to the next topic.

Now to "walls".

Scaled and with debug wireframe. Click for full size.


Walls are made of interconnected convex polygons. I first divide the scene into a regular grid of cells and place a point in each cell with a random offset to the center. This is a nice little trick to create a point cloud that looks random-ish to a human but is predictable like a regular grid. Then I generate a voronoi diagram on those points - voronoi diagrams result in convex polygons by principle, and you can construct the edges very quickly because you know all neighbours due to the regular grid.

With convex polygons, collisions are somewhat easy. I currently support point, circle and capsule (== Ray With Radius). Spawning a worm checks for enough space to all walls and a clear starting path so that I don't overwhelm a player by forcing a immediate sharp turn on her. All the ~50k of haze particles are also checked against the walls.

Then rendering. I tried a lot of approaches, but it quickly turned out that just putting an "distance to nearest outside" is not a good measurement to derive a gradient from. GPU doesn't interpolate it steadily however you construct the triangles. In the end I solved it by writing one triangle for every half-edge with the two edge segments as vertex attributes. In the fragment shader I then calculate a signed distance to both edges and apply iniquilez smoothmin() to smooth the corners. smoothmin() itsself is not bias-free, which leads to an occasional jump in wall thickness across an edge, but for the moment I'm satisfied.

Now on to small plants growing on its edges. First I'm probably going for decorational stuff only, maybe some seaweed that rocks back and forth in invisible currents. But maybe I just break my "microscopic" aim with stuff that looks too much like a macroscopic plant... I'll see.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Shephf
Level 1
*



View Profile WWW
« Reply #4 on: December 09, 2019, 12:01:53 AM »

Man, I kinda missed that one, I've just noticed a link in your signature accidentally Smiley
Cool stuff, I also had a lot of fun with slither.io, but their performance...
I also like the idea to make it more advanced, like with walls and stuff, are you planning any other additions to the gameplay ?
Logged

Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #5 on: December 09, 2019, 02:07:32 AM »

Dev took a hit the last weeks because I just gamed in my sparetime. I'm back on track now, currently working on deco plants growing on the walls.

But there's a lot more gameplay coming, too. Or at least I intend it to be. Next up will be sort of a food flower on a wall: it has a head with a larger food bit in it connected to the wall base by a small pale cord. The player has to cross the cord with her worm to snap it, then the head pops open and she (or someone nasty close by) can eat the ration.

I'll also add regions with small flowers at walls with regrowing food bits on their heads. The idea is to encourage the player to scrape the wall surfaces for those food bites, intentionally exposing their worm to the danger of collisions and being pushed into the wall by possible other players nearby.

I want a thick-peeled cell blob with rich food in it that the player has to bust open by wrapping her snake around it and then PULL.

I'll probably add small jellyfish like creatures that contain a large-ish food bit. The player can simply eat those directly, but they try to squirm away from you.

Plus a lot more when I'm that far.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Shephf
Level 1
*



View Profile WWW
« Reply #6 on: December 09, 2019, 02:15:48 AM »

Sounds great, most snake games don't bother with food pickups at all, they just have apples or something lying around for player to pick up. Looking forward for your food system in action Smiley
Logged

Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #7 on: September 21, 2020, 04:06:42 AM »

Left the project hanging during various times, some of them corona-induced hardship. Now that my ancient Amiga game Crossfire II is out on Steam, I returned to my other projects. One of them is Snake World.

The new thing is decorational weed on walls. Looks somewhat weird right now, it's coder's art. I employed the bended-snake-renderer to dynamically generate a bunch triangles for each plant at every frame. It's static for now, but swaying and waving when a snake passes is next on the list. Hopefully then the general impression is more seaweed-like, too.


Click for full size.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
JobLeonard
Level 10
*****



View Profile
« Reply #8 on: September 21, 2020, 07:15:54 AM »

This looks very cute! Don't knock your own gfx style Smiley
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #9 on: September 24, 2020, 05:11:51 AM »

Thanks. I'm still unsatisfied with the overall look, but the movement of the weed definitely helped. I tried OBS and Streamable, and apart from occasional stuttering it works really well.

https://streamable.com/62xv7q  (60s)
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
JobLeonard
Level 10
*****



View Profile
« Reply #10 on: September 24, 2020, 05:16:09 AM »

I like it! Smiley

Could you describe what you don't like and what you would like to see instead? That might help clarify things to yourself (and for us to give useful feedback)
Logged
SmackDown17
Level 0
*


View Profile
« Reply #11 on: September 24, 2020, 05:47:38 AM »



 Cheesy Cheesy Cheesy Cheesy Cheesy
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #12 on: September 24, 2020, 06:04:33 AM »

Someone sure holds a grudge for a long time. Bonus points for erasing the context.

JobLeonard:



a) I don't like the shape of the tentacles. That little blob at the tip doesn't really look like it serves a biological purpose.

b) The start of a tentacle needs some fluff, some base so that it looks like it holds onto the surface somehow.

c) it needs some variation. I tried colouring, but that looks just random, and I wanted to keep its appearance "neutral" to reenforce that it's purely decorational.

d) I still want to add some water swaying even though a real scene in a microscope looks very statically.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
SmackDown17
Level 0
*


View Profile
« Reply #13 on: September 24, 2020, 06:48:21 AM »

Someone sure holds a grudge for a long time. Bonus points for erasing the context.

The thread title and post number are in the screenshot  Cheesy Cheesy Cheesy Cheesy

And no, I have nothing to do with that game or team. I am a lurker who is interested in learning more about the community. I got a bad first impression, because that thread was the very first one I clicked on. You have to be a tremendous douchebag to talk about someone's project that way in their own thread. Have some valid criticism? Go ahead. But all you had to offer was unhelpful insults.

Thanks for the laugh. I immediately went to go see if you can back up your shit talk, and of course, you can't. Your game looks no better than anything I've seen here. Your skills are weak. Until you have the actual skills to step up, keep your mouth shut.
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #14 on: September 24, 2020, 10:38:30 AM »

I see. Thanks for your input.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
JobLeonard
Level 10
*****



View Profile
« Reply #15 on: September 24, 2020, 11:15:24 AM »

So yeah, that's a pretty active-destructive post Schrompf made there, but that doesn't exactly make this excusable behavior either.

I mean, you registered today with the username "SmackDown17" and with the only apparent intent being to post here with that screenshot from this forum from one year ago (you know you can also just link to it right?), and trying to incite some drama.

I'm pretty sure that it is against some forum rules.
« Last Edit: September 24, 2020, 11:50:11 PM by JobLeonard » Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #16 on: September 24, 2020, 11:10:25 PM »

Probably a misunderstanding even: I only meant the "daily gift" aspect back then, which really reeks of Mobile, while he probably assumed I meant the whole game. I definitely could have worded it better, the remaining part of project is ok.

But it's now off his chest after all this time, so let's put the issue to a rest.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #17 on: September 25, 2020, 05:03:03 AM »

Debug-View: I'm on the hunt for a bug which displaced the vertices uglily but only if the tentacle is heavily bent. Probably a sign somewhere in there.

Logged

Snake World, multiplayer worm eats stuff and grows DevLog
JobLeonard
Level 10
*****



View Profile
« Reply #18 on: September 25, 2020, 06:26:26 AM »

Is there an atan2 or something along those lines in the code somewhere? Could be a sudden 180 degree switch in rotation maybe
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #19 on: September 25, 2020, 07:01:15 AM »

No atan2(), only vector math. I think I found it. The code to displace the middle vertex pair to mimic a curve went off when the segment was unnormally long.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic