Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1034466 Posts in 41726 Topics- by 33329 Members - Latest Member: Seki

August 21, 2014, 12:16:37 AM
TIGSource ForumsFeedbackDevLogsGastropoda. Browser based snail breeding/racing simulation
Pages: [1] 2
Print
Author Topic: Gastropoda. Browser based snail breeding/racing simulation  (Read 1460 times)
Liza
Level 1
*



View Profile WWW Email
« 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: June 20, 2014, 12:35:22 AM by Liza » Logged

johnki
Level 9
****


Invisi-wizard


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 Email
« 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 Email
« 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 1
*


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
Liza
Level 1
*



View Profile WWW Email
« 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 Email
« 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 Email
« 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 this and this 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 Email
« 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 Email
« 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 Email
« 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 Email
« 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 Email
« 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

Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic