• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Ditto - Pokemon Engine in Python

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
The Ditto Engine is a project to create a fully functional Pokémon game engine in Python.

Features
-standard map support: multiple layered maps from Tiled, collision detection, connecting maps
-animations: ambient (like flowers) and triggered (like grass and doors)
-scripting: with custom scripting language
-events: warps, dialogs
-NPCs and trainers
-intro screens
-new game scene
-game saving and loading
-sound: map music and sound effects
-menus:
-Party
-Bag
-Trainer card
-map screen
-HMs: cut type HMs (ie Cut, Rock Smash, Whirlpool), Strength, Surf, Waterfall, and Flash
-running
-ledges
-sliding (ice) tiles and directional (like in gyms) tiles
-weather
-basic battle engine
-map metadata editor

Screenshots
Spoiler:


Videos
Spoiler:


How YOU can help
-Any programmers out there who fancy helping this project, let me know. Take look at the code, write new features, whatever you like. The more the merrier.
-If anyone wanted to do a logo etc. for the project, that'd be nice.
-If you can think of another way you could be useful, tell me!

Credits
SooperTrooper - has done some serious graphics work getting all the sprites ready for the engine.
monkeyman192 - has been programming quite a few nice things for the engine.
Essentials - as I've been shamelessly ripping assets from it :P

Well, there you go! I'll try to keep this updated as I work more on the engine.
 
Last edited:

Dragonite Ernston

I rival Lance's.
149
Posts
13
Years
  • Seen Jun 15, 2016
So what I want to know is, does it support battles yet? It seems that any engine I've seen in development always has either one or the other, but I haven't seen one with both yet.

As for your conversion requirements, consider using ImageMagick. It's a program that massively renames and converts image files as you seem to need.
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
So what I want to know is, does it support battles yet? It seems that any engine I've seen in development always has either one or the other, but I haven't seen one with both yet.

As for your conversion requirements, consider using ImageMagick. It's a program that massively renames and converts image files as you seem to need.

No battles as yet I'm afraid (though obviously they're planned). Two reasons, firstly I feel that the world should be as near to complete as possible before I move on, and secondly because I'm considering writing the entire battle engine as a plugin which would allow people to plug in their own completely separate engines if they wanted realtime or some other battle format. I'm not in a position to start yet.

I know what you mean about half-finished engines, and all I can say is I hope this project stays alive long enough to become viable for games...

I've downloaded ImageMagick, it seems like just the tool for the job, so thankyou! Now just to learn to use it.
 
14
Posts
16
Years
  • Age 30
  • Seen Jun 30, 2014
If you want images, check out veekun.com. He has huge files full of seperate images of every pokemon from every version, sounds and footprints, and stuff like that.
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
If you want images, check out veekun.com. He has huge files full of seperate images of every pokemon from every version, sounds and footprints, and stuff like that.

Cheers for the link!! Looks like he has good resources and also there's a fair bit of code for me to look at.

Almost managed to get the pokemon battlers as required now - it's not a priority but I'd appreciate some help at some point...

Update
Over Christmas i did what any good programmer should and did a full code review, which was painful. But it means everything's a lot more organised, a little quicker, and a lot less embarrassing for me to show you guys. That said, I'm working on getting a demo together so you guys can play around with the engine yourself, so expect that in the next few days.

I've attached some more screenshots, including one using Gen 4 tiles, and one of the XML files which are used to define the game. Take a look!
 

Ayutac

Developer who wants your help
157
Posts
12
Years
I don't understand, why don't the java developers work together? Much more can accomplished this way!

(Also offering my help)

Pretty much this. Is there something like a flu going around causing programmers to develop indepent Java Engines? For the sake of useability for others, work together damnit! It's not like there aren't things like CVS.
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
Pretty much this. Is there something like a flu going around causing programmers to develop indepent Java Engines? For the sake of useability for others, work together damnit! It's not like there aren't things like CVS.

I think this is a very closed-minded comment, but I'll try to respond...

1. Python != Java. It's as simple as that. I'm not nearly good enough at Java to take on this kind of project, and I have no idea whether the others have even heard of Python.
2. People do this stuff as a hobby. There's a lot of satisfaction from seeing what you've managed to do, and from learning to program like this. I'm under no illusions about the likelihood of finishing an engine, but I'm gonna try!
3. Because of how these forums work (and make no mistake I agree with it) you need to have something to show before you make a thread. I did about 4 months work before I posted on here; I assume the others did the same. You can't be expected to scrap all that if someone else posts a few weeks before you.
4. Working together is still possible. You'll notice that danice123 posted a link on this thread, and I would be happy to help anyone else who wanted it.
5. Variety is good. Not bad.

I think that covers a lot of it. I understand what you mean, but really there's nothing to complain about.
 

Ayutac

Developer who wants your help
157
Posts
12
Years
I'm terrible sorry for assuming you wrote in Java instead of Python! I just... saw two Java Engines and then there's another engine and if I recall correctly there wasn't a hint of not using Java, so I assumed... Again, I'm sorry. My post is kinda irrelevant under these circumstances.
Nevertheless your arguments are good. I'm the kind of guy who simply does not think of certain arguments. So... thanks.

Anyhow, I thought posting such projects would include the intention to finish it?
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
I'm terrible sorry for assuming you wrote in Java instead of Python! I just... saw two Java Engines and then there's another engine and if I recall correctly there wasn't a hint of not using Java, so I assumed... Again, I'm sorry. My post is kinda irrelevant under these circumstances.
Nevertheless your arguments are good. I'm the kind of guy who simply does not think of certain arguments. So... thanks.

Anyhow, I thought posting such projects would include the intention to finish it?

Fair enough, you're making a fair point though, and your thread is well worth reading.

I am hoping to finish this engine, but looking at other engines out there I can see that it's very rare for that to happen. But maybe this one will break through and actually become useful for game production, who knows?

With that in mind, I've decided it's worth uploading the engine as is, so it should now be attached to the main post. Hopefully people can start trying it out, and let me know what they think, and any programmers can inspect my code :)
 

DaSpirit

Mad Programmer
240
Posts
16
Years
I am hoping to finish this engine, but looking at other engines out there I can see that it's very rare for that to happen. But maybe this one will break through and actually become useful for game production, who knows?
It's only as helpful as you make it. If possible, find a project willing to use your engine that way you HAVE to work on your engine. Making an engine alone is boring.

Anyway, I'll install Python later (it's been a year since I've used it and didn't install it on this computer yet). You should look for a way to create an executable.
 
1
Posts
11
Years
  • Seen Apr 8, 2013
I'm a coder, I could try to make myself useful. I don't come on this forum very often though and I only just made an account to post this. I'll PM you my email for if you need to reach me for anything. Are we using Python 2 or 3 here?
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
It's only as helpful as you make it. If possible, find a project willing to use your engine that way you HAVE to work on your engine. Making an engine alone is boring.

Anyway, I'll install Python later (it's been a year since I've used it and didn't install it on this computer yet). You should look for a way to create an executable.

Great, do let me know if it works :) I am looking at executables, there are a few possibilities, but unfortunately when you develop in python you trade off very rapid development for a less than ideal distribution...


xGeovanni said:
I'm a coder, I could try to make myself useful. I don't come on this forum very often though and I only just made an account to post this. I'll PM you my email for if you need to reach me for anything. Are we using Python 2 or 3 here?

OK super, I'll email you soon. I'm just trying to get the source onto GitHub. We're currently using Python 2, because I think pygame struggles a bit with Python 3. That might have been fixed by now though. In the meantime, if you download the demo I put up and have a look at the source, you can at least get familiar with the project.

Great to have you on board!
 

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
My Python coding skills are next to nothing, so I probably wouldn't be much help. However, I'm full on support for this project and may be able to help with things such as graphics and file conversion like you stated in your first post.

Whatever I can do to help, besides coding with Python of course, just send me a PM.
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
My Python coding skills are next to nothing, so I probably wouldn't be much help. However, I'm full on support for this project and may be able to help with things such as graphics and file conversion like you stated in your first post.

Whatever I can do to help, besides coding with Python of course, just send me a PM.

Great I'll send you something and you can see if you fancy helping.

@xGeovanni I've sent you an email, hope it's come through.

UPDATE

The engine now has it's own scripting language! So scripts look something like this:
Code:
###givepokemon###
lock();
facePlayer();
choiceDialog("Would you like a free pokemon?", "Abra", "Eevee", "Staraptor", "No thanks");
if LASTRESULT == "No thanks"{
    dialog("Oh.$$OK then...", 1);
}
else{ 
    if LASTRESULT == "Abra"{
        p = generatePokemon("ABRA", 10);
    }endif
    if LASTRESULT == "Eevee"{
        p = generatePokemon("EEVEE", 25);
    }endif
    if LASTRESULT == "Staraptor"{
        p = generatePokemon("STARAPTOR", 100);
    }endif
    PLAYER.addToParty(p);
    dialog("Here you go!$$Enjoy...", 1);
}endif
unlock();

So I'm hoping it should be pretty obvious what it does, the idea is that it's easy to start using.
Let me know what you think.
 

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
That looks very well done. It's clean, easy to understand, and looks fairly easy to use. Nice work once again.
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
SooperTrooper said:
That looks very well done. It's clean, easy to understand, and looks fairly easy to use. Nice work once again.

Cheers, I'm hoping it'll stay that way as more features get added...
I sent you a pm just now, so let me know what you want to do (if anything :P)

Thecardlunatic said:
Screenshots look very good Very good work!

Thanks! I've attached a couple more to this post showing HMs in action.
 

Mortalis

[css-div="background-color:#4e9dda;text-align:cent
345
Posts
13
Years
Hey guys, just a small update on my part:

I've got almost all of the sprites resized (took me a while because Photoshop kept crashing for some reason and deleted all of my progress.) I'll be working on conversion and transparency background this coming week, I'll probably have them all ready for the project soon.

I may even be able to get started on naming them correctly. If there's anything else you need to me to do, send me another PM or two. (:
 

andytu

Ditto engine developer
27
Posts
13
Years
  • Seen Apr 21, 2014
Hey guys, just a small update on my part:

I've got almost all of the sprites resized (took me a while because Photoshop kept crashing for some reason and deleted all of my progress.) I'll be working on conversion and transparency background this coming week, I'll probably have them all ready for the project soon.

I may even be able to get started on naming them correctly. If there's anything else you need to me to do, send me another PM or two. (:

The sprites all inserted perfectly!! Screenshot attached.

Thanks a bunch!
 
2
Posts
11
Years
  • Seen Sep 11, 2015
This looks really cool and I would definately like to help somehow!
I have a moderate amount of experience with python, however I have python 3 (P3 for brevity) installed at the moment...
I have had a go using pygame before to make a game of my own (which atm is only in the "physics engine works... kinda" stage), but there didn't seem to be any issues with it working with P3. I might see if I can change some of the code in the demo to P3 syntax and see if it still runs.
Send me a pm if you would like and hopefully I can help out :)
 
Back
Top