Jump to content

How to implement a virtual pet game


greendot
 Share

Recommended Posts

Hey guys,

I need to implement a simple virtual pet game where users can dress them up with clothes, hat, etc. The pet will have simple animations such as when touched, or fed, it'll do a gesture and stuff like that.

I have never coded a game before so I'm unsure what framework and path to take. Also, in terms of graphics, what would it be the best approach? For example, how can I add a piece of clothing to the pet and this added piece be part of the animation? Maybe is there an example somewhere where I can get some ideas from?

 

Thanks! 

Link to comment
Share on other sites

Hey dude, if you're not a coder then using an existing game making software is a very good idea. One thats really popular right now and quite easy to use is Construct 2 (just google it).

As for graphics inkscape is a good free vector software, its a bit like working with circles and squares to make the image you want and the youtube tutorials will probably help with graphics.

Once you find out what framework or software you want to make it in, you will be able to find examples of games which have some of the mechanics you need. For example construct 2 has animation mechanisms so you'll want to find them, it also has "pinning" e.g. pin a coat to the animal, which you'll want to look into.

One tip for a non-coder: you WILL have to learn bits of code in order to make your game, unless you can just buy someone elses game. So you will need to learn how to make things change when you click buttons, how to figure out if two things are hitting eachother. This stuff is really simple in Construct 2, but still requires understanding of code.

Hope this brief info helps.

Jammy.

Link to comment
Share on other sites

Thanks a lot Jammy, I have never heard of Construct 2 before. I guess I have to try different frameworks and see which ones I like the most. So far Phaser is at the top of my list due to its huge community involvement.

Also, thanks for mentioning the "pinning" mechanism, this is something I haven't heard before as well :)

Link to comment
Share on other sites

Naming things is tough, for example, framework for some means a coding library, for others it means tooling like Construct or Game Maker that scaffold your game and provide a GUI to 'write code for you' in certain places. For me, those products are tooling that allows you to create games, they aren't engines, nor are they frameworks. A framework is a suite of libraries that you use to create an application (i.e. Phaser, Angular, Ember), a library is a smaller module or a set of modules with a very tight scope i.e. they do one part of the puzzle very well (i.e. React, Hammerjs, Howler, Axios, Lodash) and a module is an even smaller abstraction that has a very tight scope (i.e. Redux, raf-loop, left-pad). The term engine doesn't tend to get used very much in the JS world (nor should it) as its typically a lower-level sort of thing i.e. you could create an 'engine' for something like rendering but you'd probably want to bolt on an API of some sort on top to make it easier to consume, its somewhere between a framework and a library as it would typically have a fairly tight scope but also be reasonably complex.

As always, as much as you try and create regular conventions for nomenclature people's definition of these words does differ.

How much coding do you want to do?

Stuff like Construct and Game Maker can be very powerful but they shield you from the code, I'm sure you still have to do plenty of coding but the nuts and bolts you'll be blind to, which means less flexibility and if you run in to problems then identifying where those problems lie can be impossible.

Stuff like Phaser is a framework, its a collection of libraries that solve common game application problems (rendering, user input, sound, structure etc) and some glue. You'll still have to do lots and lots of coding but it'll help you into a structure that allows you to be productive and its saves you the worry of solving some common problems during development. The only issue with frameworks (as a coder) is that it sometimes feels like they run the show and they occasionally let you write some code.

You can go more barebones and use lots of modules and glue them together yourself. Taking the library route lets you be in charge of writing your code, with the responsibility of solving most of the issues yourself. Libraries let the coder be in charge, you employ them for certain tasks, a framework is more pervasive and lets you write codes in little windows, but, either approach (or the tooling approach of stuff like Construct which is almost like an uber-framework, much much more prescriptive) is very valid and its up to you how dirty you want to get your hands.

In contrast to Jammy I'd say that if you're in this to learn coding then get your hands as dirty as possible. If you start shielded then you tend to stay that way, if you want to learn to code then learn to code, don't hide behind frameworks and tooling, you can do that later when you know enough about coding that you know how to employ all these libraries, modules, frameworks, engines and tooling.

Link to comment
Share on other sites

Thanks a lot for all the replies. That spine software looks good. I've let the guy who will work on the animation know about it, and I'll try it out once I have some free time.

I actually know how to code, but I mostly do backend stuff such as php and nodejs - I have never done any game development. I have a WebGL book I bought recently but didn't have time to read it yet - it might help me some with game dev too :)

On 3/28/2017 at 10:29 AM, totor said:

just google the title ;)

Trust me, I've done that before posting here. :) I found some examples, but nothing that explains stuff like customizing the pet with clothing and have it fully animated at the same time. If the pet wasn't customizable, I could easily accomplish the animations with sprites, but by adding these elements, we'd have to create sprites for each different combination of accessories which would then become very impractical to develop.

Link to comment
Share on other sites

You can add pieces of clothing etc. as layers or limbs to the main image, then move them as a group to develop an animation. This just requires keeping a tab on the sprite origin coordinates so that each layer is correctly positioned. This way you have the minimum number of sprites - one for each piece of clothing. Otherwise, like you say, you'll end up with hundreds, possibly thousands of sprites - which will likely cause performance problems as well as the time doing all the animation.

Link to comment
Share on other sites

51 minutes ago, IndieDevBateman said:

You can add pieces of clothing etc. as layers or limbs to the main image, then move them as a group to develop an animation. This just requires keeping a tab on the sprite origin coordinates so that each layer is correctly positioned. 

This is pretty much what spine would do for you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...