Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 06:37:19 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSnailLife (prev. Gastropoda). Browser based snail simulation.
Pages: [1] 2 3
Print
Author Topic: SnailLife (prev. Gastropoda). Browser based snail simulation.  (Read 6875 times)
Liza
Level 1
*



View Profile WWW
« on: May 13, 2014, 11:31:25 AM »


Gastropoda is a snail breeding and racing simularion. It's been in my head for years. Last year I made a very rough playable prototype in JS/HTML5 (titled The Game of Snails at the time), but I always envisioned it as a PHP browser project, so that's what it's going to be.

My main dev blog is on my personal blog, but I will post unique (maybe slightly more frequent and briefer) progress updates here as well.

The first post will mostly outline the concept of the simulation. Actual progress updates will come throughout the course of the thread.

Disclaimer: I am not an artist. All art is placeholder.


(This is the boring part)

Goal

The goal of making this simulation is fun. Fun for me, I mean. It probably won't be much fun for anyone else, but that's ok - that's not the goal. Some planned features are quite ambitious, so this is probably going to be one of those long drawn out projects that'll never be fully finished. I do not plan to monetize it..

Origin

I must've been around 6 or 7 years old, playing in the rain at my grandparents' summerhouse in Kherson, Ukraine (near Dnepr river). It was raining and the snails had crawled out into the open to enjoy the moisture. I got our orange fishing bucket and collected a few, making a small and crappy terrarium for them with sticks, leaves, and a pool of water underneath (in hindsight not a good idea - snails can drown).

Then the training began. Most people don't believe me, but I swear I taught my snails to crawl side by side in a straight line. Snail racing!

I kept the snail for a few days with the bucket covered to prevent them from escaping. At some point, however, I had to go fishing - and I needed my orange bucket. That evening I left the bucket uncovered for them, expecting them to be gone the next day (freeing up the bucket for the fishing trip).

In the morning, however, the snails were still there. "Fine", I thought. I left the bucket open and waited, figuring maybe they'd escape during the day.

And escape they did. I saw them in the general vicinity of the bucket throughout the day, figuring they'd make it to the bushes soon. Then I could take the bucket fishing the next day instead.

That evening, however, I saw the snails crawling in the other direction! One by one they all returned to the bucket (and a couple never left).

This went on for a couple of days - the snails came and went as they pleased, but they were always back in the bucket in the evening. All of them. I later found out that snails have a very strong homing instinct. Still, nobody believed me.

By the third or fourth day I was sick of it. I really needed my bucket. Annoyed, I threw them into the bushes one by one (accidentally injuring one's shell in the process - something I feel guilty about to this day), threw everything out of my bucket, and went fishing.

Since that day I have felt bad about the snail I hurt when throwing them away too roughly, and I've had a soft spot for snails ever since.

Years later, when I discovered PHP browser games, the idea to make a snail racing simulation came to mind. I had a few false starts, but now I know I can actually do it.



There are two main parts of the project - snail breeding and snail racing. Between that are snail raising/care and training. There will be a rudimentary virtual currency and economy to simulate the cost of caring for snails, but this is the part I'm looking forward to building the least.

Personally, I'm most excited about the breeding part, but the racing part will be a valuable tool to drive people's breeding goals (later I would love to add 'conformation' shows, but we'll see).

The User's Space

A user's personal profile is broken down into three main parts:
  • Their stable
  • Multiple jars within the stable
  • Multiple snails within the jars

Breeding

More info on breeding to come. Rough outline of breeding system/snail genetics for JS version of the project is here.

Racing

Snails race in steps (each step being a centimetre). Currently the only stats taken into account are initiative, speed, and endurance. However the goal is to give each snail the potential to perform _actions_ throughout the race (based on its behavioural traits).

Old Age & Death

Snails can die due to:
  • Old age
  • Mistreatment
  • Illness
  • Purposeful euthanasia

Items

Snails need substrate, jar accessories, food, medicine, steroids (well, they don't _need_ these), and other care items.

Illness

Snails can get sick and spread their illness to other snails they come in contact with (in a jar, a race, during breeding, etc). They can be cured via medicine.


Currently implemented in PHP version:

  • User registration/login
  • Catching wild snails
  • Generation of randomized wild snail
  • Snails rendered on HTML5 canvas, seen crawling around at a speed relative to their actual speed stat
  • Multiple snails (in jar view) seen crawling around the jar, also rendered on HTML5 canvas
  • Moving snails between jars
  • Renaming snails and jars
  • "Breeding Jar", which when two or more snails are present starts the arousal/mate choosing/breeding process (already hooked up to DB)
  • Cron job to execute queued breeding events
  • Generation and saving of newborn snail based on parents' genes/attributes
  • Snail ageing - superficial only, age doesn't yet have any effect on stats
  • Creating and entering snail races
  • Running the actual race and ranking the snails
  • Consumable items with correct nutrition properties
  • Snails can eat/bite consumable items to receive nutrients
  • Snail energy is depleted according to their metabolism
  • Macro distribution requirements is unique between snails

« Last Edit: July 29, 2015, 09:19:22 AM by Liza » Logged

pluckyporcupine
Level 9
****


View Profile WWW
« Reply #1 on: May 13, 2014, 01:08:05 PM »

I made something like a simple version of this for a jam once. looking forward to seeing where this goes!
Logged

Liza
Level 1
*



View Profile WWW
« Reply #2 on: May 13, 2014, 01:25:24 PM »

I made something like a simple version of this for a jam once. looking forward to seeing where this goes!

Oh really? I looked for other snail games in the same vein, would love to see yours.

Right now I'm mostly just porting all the functionality I already have in the JS/HTML5/Node.js/Mongodb version to PHP with some small tweaks. The basic breeding and racing functionality was already there in a rudimentary form.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #3 on: May 14, 2014, 12:25:39 PM »

I've been sick all day, made no progress. Fever just went down so I spent 30 mins or so finishing newborn snail generation. So...presenting the first two snail babies.

Both of these came out of a breeding with these two dudes: Sequel and Deep Purple. I don't have orientation ticking slowly back to neutral yet, so Sequel bred as male and Deep Purple bred as female for both matings.


The two babies (from individual breedings. Eventually snails will be able to produce 1-5 snails per breeding):


Lots of work to do. Separating stuff like functional and visual traits to their own tables in the DB (as well as a heritage table). Fixing up stuff, implementing a revised attribute system, etc. But not tonight. Tonight I go back to sleep.
Logged

alvarop
Level 9
****


ignorant


View Profile WWW
« Reply #4 on: May 14, 2014, 07:57:22 PM »

I like because snails. When I was a kid, me and my sister used to put sticks in them and swirl them around to make snail juice.

 Shocked Shocked Shocked Shocked
Logged

i make games that can only ever be played once on http://throwaway.fun
Liza
Level 1
*



View Profile WWW
« Reply #5 on: May 14, 2014, 11:24:45 PM »

I like because snails. When I was a kid, me and my sister used to put sticks in them and swirl them around to make snail juice.

 Shocked Shocked Shocked Shocked

Did you drink the juice? Shocked
Logged

Liza
Level 1
*



View Profile WWW
« Reply #6 on: May 15, 2014, 03:04:03 AM »

Separating all the snail attributes into different tables. I think I'll end up with something like this:

snails
snail_genes
snail_heritage
snail_visual_attributes
snail_functional_attributes

snail_race_records (I'm not sure if I'll need this, as snail placements etc will be held in one of the race tables and I can query which snail won what from there. I'm just not sure if it would eventually take too long to for example find the numbers of wins/losses/placements of an individual snail this way..we'll see)


I've been doing some experimental breedings and looking at the snail_genes table to make sure that the alleles are being set properly. An example:


I looked at the pattern color gene as an example, drawing up a list of possible results in the baby snail based on the parents:



In this case, the baby snail's patternColorGeneAllele1 was r and patternColorGeneAllele2 was g. In my made up world Red is always dominant to Green, so the pattern has a red hue.

I should note that I know next to nothing about genetics, but it's been really interesting to read about how snail mating and gene selection works in general. I will strive to make the simulation as realistic as is practical.
« Last Edit: May 19, 2014, 10:55:24 PM by Liza » Logged

Scott
Level 2
**


View Profile WWW
« Reply #7 on: May 15, 2014, 05:40:10 AM »

I find this hilarious! (in a good way)
Logged

Liza
Level 1
*



View Profile WWW
« Reply #8 on: May 15, 2014, 06:27:14 AM »

I find this hilarious! (in a good way)

Sometimes while I'm working on it, it hits me that I'm sitting here listening to things like

and

while implementing snail arousal timers and jotting down ideas for the steroid system, next to a terrarium of real life snails (which I'm keeping for scientific game-research purposes...). Then it becomes kind of hilarious to me, too. In a sad "I've just realized I'm a total weirdo" kind of way.

Logged

Liza
Level 1
*



View Profile WWW
« Reply #9 on: May 18, 2014, 07:08:21 AM »

Have been restructuring a bunch of stuff. I've also implemented some basic snail ageing (though it has no effect on the actual condition of the snail yet). Also started on basic race functionality.

Logged

Liza
Level 1
*



View Profile WWW
« Reply #10 on: May 19, 2014, 01:31:58 PM »

First, hi to the RPS visitors  Coffee

Next - basic race creation is now in, as is entry. The main thing left to do aside from checking for duplicate snail entries and such is the formula for the actual race. I'll start off by porting the very simple race formula from the JS version of the game while planning out the "proper" way of doing it.

In theory, I want to calculate the race in steps - or centimetres. Every 1cm, a snail can potentially perform an action based on its personality traits (such as aggression) and the owner's pre-race instructions (impacted by the snail's trainability stat). In practice...well we'll see.



You can't see it above, but when creating a race you can also decide on what kind of terrain you want the snails to race on as well as the distance of the race. You also set stuff like the race description.

I've also been thinking about snail maturity. Currently snail age is calculated in days. When observing my real life snails, it strikes me how quickly they grow. Snails that looked like tiny hatchlings about a week ago are now much larger - I'd go so far as to say "medium sized". The suckers grow fast! Each snail in Gastropoda will have a unique maturity rate - how quickly it develops - but I have to decide on things like an average lifespan, breeding age, etc.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #11 on: June 19, 2014, 01:47:54 PM »

I haven't posted in a while because at some point it didn't seem right to post Gastropoda on TIG anymore. It doesn't really feel like much of a game - it's a simulation with no real fun involved. At least, I don't think it'll be fun to anyone but me. But then I figured...whatever. I may as well keep going with the dev log.

So what I'm up to now:

Racing update
Racing is more developed. Basically race is created, a minimum number of snails enter the race, a cron job starts the race at the correct time. The snails race in centimetre "steps" (based on initiative). I did it this way because in the future snails will have the possibility of performing an _action_ at any one step. The action can be influenced by both their behavioural traits and user input. For now, the outcome of the race depends purely on a snail's initiative, speed, and endurance. I go into a bit more detail about how the races work here.



Nutrition update

I've been doing research on snail nutrition (and nutrition in general). I'm gathering studies about snails specifically, but during the initial prototyping stage I implemented some of these features by using hacky human nutrition concepts.

Snail energy is measured in Joules and macros and vitamins in milligrams. Each snail has an "idealEnergy" amount. Their currentEnergy is calculated based on their macros using the following guidelines:

* 1g protein = 4 calories
* 1g carbs = 4 calories
* 1g fat = 9 calories

Different snails may need a different proportion of macros to make up their "ideal" diet, so values for the ideal _percentage_ of energy which comes from each of the above is also generated.

More details on this here.

Vitamins, too, will have a special role to play. They will be partially responsible for the snail's health - a will be able to become sick with specific illnesses due to vitamin deficiencies (eg they need Vitamin D to property absorb Calcium, which is extremely important for snails)

Item update

Based on the above, I've implemented the first item. It's a consumable (Lettuce Leaf) that the snail gets nutrients from when it takes a bite. The values are based on those of an actual lettuce leaf. More info here.

Snail history logs

Snails also now have history logs where certain events get recorded. So far there are log templates for 6 kinds of events: birth, death, food consumption, energy consumption, race finish, race dropout. Not all of them are hooked up yet (birth, food consumption, energy consumption, and race finish are in). More info on those here.



Site layout
I've done some minor messing around with the layout to make it a _tiny_ bit less awful, but it's still pretty awful.

And that's it for now. Right now I'm mostly reviewing a lot of the nutrition implementation, commenting stuff, cleaning up, etc before moving on to more features.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #12 on: July 09, 2014, 07:11:44 AM »

For the past couple of weeks I've experimented with porting Gastropoda from PHP and MySQL to Node.js and MongoDB. It went ok, but I just didn't have as much fun as I have been with PHP (despite being more comfortable on the whole with JavaScript). I go into more details here.

So since switching back to PHP a couple of days ago I've implemented the following:

* Snails now die if their energy <= 0
* There is a shop that gets restocked (currently every 5 mins) with lettuce leaves
* Each user gets 500 SEK (currency) when they start, which they can spend on items at the shop
* There is now a "closet" page where you can view all of your available items and place them into jars for snails to interact with/eat.

I go into some detail on that here.
Logged

jonbro
Level 3
***



View Profile
« Reply #13 on: July 09, 2014, 09:31:38 AM »

those photos of snails are so great! I hope some of that color makes it into the game, but probably something you want to save for later once you have the core implemented.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #14 on: July 09, 2014, 10:00:46 AM »

those photos of snails are so great! I hope some of that color makes it into the game, but probably something you want to save for later once you have the core implemented.

Thank you! I've got to dig my camera back out after my move to take some more. The current snail graphics are definitely placeholder - I do hope to capture some of the more vibrant feel of real life snail shell colors and patterns down the line.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #15 on: July 31, 2014, 03:38:41 PM »

Lots has happened on Gastropoda in the last few weeks.

  • Migrated the whole thing from vanilla PHP to Laravel
  • Set up web hosting for the site, though the site isn't actually deployed on it yet. All I have there right now is one PHP file with a progress log updated based on my Trello board (http://gastropoda.liza.io)
  • Speaking of - I set up a public Trello board
  • Implemented race logs, so now you can see stuff like who got out of the gate first, what position snails are at various points in the race, which snails dropped out, etc. I still have to find a good way to format these.
  • Created a race actions template table. This is used not just for normal move actions, but stuff like snails attacking each other etc.
  • Created a Twitter account where commit descriptions are autoposted
  • Created 3 new shell patterns and made a new genetic trait - shellPatternRadius. I also wrote a blog post describing how breeding works, with an example, and with some screenshots of the new patterns. I've had to reconfigure how this works because it was all wrong before...the more I learn about genetics and biology the more changes I have to make, and this will continue.

I'm now implementing a new item - sweet potato. I'm tired of buying my snails craploads of lettuce to make sure they don't die. I'll just start dumping huge potatoes in their jars and let them chomp away indefinitely.

Some images of the new patterns below. These are still total placeholders and will change; I just needed more variety to work with.






Logged

Savick
Guest
« Reply #16 on: July 31, 2014, 03:44:36 PM »

The gradients look really out of place with the basic sprite art to me. Also, couldn't you have a background for them to race on? I'd like to see a gif of gameplay too if you can arrange it.
Logged
Liza
Level 1
*



View Profile WWW
« Reply #17 on: July 31, 2014, 03:52:24 PM »

The gradients look really out of place with the basic sprite art to me. Also, couldn't you have a background for them to race on? I'd like to see a gif of gameplay too if you can arrange it.

I agree; these (including the art of the actual snail) are all placeholders as I mentioned. I'm focusing more on the functionality as opposed to the art right now because I need more variety to work with as I flesh out the breeding system.

As for a background to race on - it's not really that kind of simulation (although I do plan on adding backgrounds to jars, plus the user will contribute to that when the ability to arrange the items they place into a jar comes in. Substrate, food, decoration, etc will all contribute to the visual appearance). The whole thing is 90% text based. Currently in a race you don't _see_ the race, you only see its results in text form on the race page after a race runs. I do eventually want to create a visual race 'replay' where you may be able to see the snails racing on an actual track, but that's filed away in my 'long term/crazy features' Trello list Smiley

So having a gif of the user process would be pretty difficult since it's mostly a lot of clicking + page loading. I _can_ get a gif of the snails visually crawling around their jars, but it'd be pretty boring as they're just moving back and forth (at different speeds based on their speed attribute). There will be more interaction with this part later (such as being able to drag/drop snails within the jar, snails possibly interacting with each other in real time as you watch inside the jar, being able to hover over a snail to see its name [this one is coming soon], etc), but the bulk of your interaction with the web app is just clicking around from page to page.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #18 on: August 02, 2014, 03:16:38 AM »

Put in the "Scout" feature. The user can now take their snail to the local scout to get more details about their snail. For example, here is what a snail's stats look like on its profile page when the user first captures it:



Then the user takes their snail to the scout...



And now the snail's profile page looks more like this:



I'm still adding more details to the profile page; once the snail is scouted the user also gets immediate access to the snail's macros.
Logged

Liza
Level 1
*



View Profile WWW
« Reply #19 on: August 02, 2014, 03:27:12 AM »

Ehh..here's a screenshot with some more nutritional details:




Logged

Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic