amethyst / evoli

An ecosystem-simulation game made with Amethyst
https://community.amethyst.rs/t/evoli-introduction/770
Other
217 stars 33 forks source link

Add a new creature (repeatable) #61

Open erlend-sh opened 5 years ago

erlend-sh commented 5 years ago

See our documentation on Creature Designs and How to make a new Evoli creature.

New creatures

joarfish commented 5 years ago

I looked into implementing Blin as specified in @erlend-sh's post.

Every new pair of blins will be randomly assigned one of 9 available styles.

I was wondering what would be the best way to implement this. The quick & dirty way, I guess, would be to just create nine creature-prefabs and then chose one randomly when a new Blin pair is spawned. Is there a more elegant way, for example allowing "graphics" in CreaturePrefabData to be an array of materials? Or using a single sprite sheet for all styles? (Sorry, if there is an really obious way to approach this with amethyst, but i'm very new to it)

erlend-sh commented 5 years ago

One of the core devs might have something cleaner in mind but we’re usually very much in favor of quick & dirty for a first iteration ;) You can use the placeholder art asset provided in that post to make a proof of concept using your proposed prefabs method.

marotili commented 5 years ago

@kastenbutt You should be able to create one prefab where you exclude the sprite. In the DebugSpawnTriggerSystem you can set the sprite based on a random number using creature_entity_builder.

This would be quick and dirty since the DebugSpawnTriggerSystem should not know specifics about the creatures.

Your solution of declaring an array of materials could be to implement by custom PrefabData called RandomSprite that contains an array of sprites. In the add_to_entity method you pick one randomly and assign it to the entity. This is a little bit harder, as I find prefabs to be unintuitive and documentation a little bit lacking, so if you encounter any issues I'd recommend to ask the Amethyst community on Discord or on the Forums