Tutorial - How to make Frogs and Flies!

Discuss Everything related to UCC, share progress of your game, ask questions, etc.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Take 2! This is my second attempt at creating a tutorial. This one will stay focused and simple so please help by keeping comments minimal and on topic. Perhaps opening another topic for comments would be a best approach since I can't seem to be able to just lock this one.

I assume many folks would wish to enter the compo but perhaps refrain because they don't know where to start. I thought about giving the example and making one myself and showing all the step along the way. Naturally the game should be simple, no scrolling and without too much bell and whistles. So I have settled for "Frogs and Flies" and Atari 2600 classic recognized for it's deceptively simple yet fun 2 players gameplay. I'll post progress as I go, so stay tuned!



For all Uzebox newbies, first things first: Learn about the basics. The Uzebox community has produced a wealth of documentation, most being in the wiki and a lot being in these forums. Here's my recommended readings:

http://belogic.com/uzebox/howitsmade.htm
Introduction to the project, why it came to be and how it works in general terms.

http://uzebox.org/wiki/
The overall wiki, scout it to give you an impression of what is available. Don't worry, if you find it overwhelming, it is normal at this point! We'll cover most aspects along this tutorial. :)

http://uzebox.org/wiki/index.php?title= ... s_And_Such
A great new series of tutorials for newbies. A must read.

http://uzebox.org/wiki/index.php?title= ... ep_By_Step
How to make music on the Uzebox, a detailed guide.

After that you may learn from some existing games projects that you like or kinda works like the game you want to make. Head for the wiki game section, which has sources for many games or the Google Code source repositoryfor the demos included with the Uzebox code base.

Happy coding!

Uze
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Day 1: Setup the project

Frogs and Flies (or f&f for short) will be made using video mode 3, the most popular video mode on the Uzebox. This mode offer 240x224 resolution in 256 with moving sprites. Mode 3 also supports full screen scrolling but, for this game we won't need it. Selecting which video mode you need is highly dependent on the type of game you want to do. Check the wiki for the list of video modes and their possibilities. In any cases, selecting a video mode is something that is done at compile time, that is, special code just for the video mode you selected will be tuned, compiled and included in your game. So the video mode is "hard coded" and cannot be switched when running your game. Such an approach is an important way the Uzebox uses to saves precious flash memory.

So first thing first, let's create the project. I'll assume you have setup the compiler and IDE like AVR Studio or Eclipse and downloaded the pre-compiled sources (recommended). My tutorial will assume you will be using AVRStudio. The easiest way to start is usually to copy the "Tutorial" project and rename a couple things. To speed up things, I've done that for you and attached the blank project ready to go. Locate where you have checked out the Uzebox sources and unzip the file under the "demos" folder:

Code: Select all

...
/bin
/kernel
/demos
  /FrogAndFlies
The project is all set and ready to go. The makefile is already configured with mode 3 and other parameters we will need. I also added a font resource file that you can also find under sources/gfx/fonts folder. You can double-click FrogsAndFlies.aps to open AVRStudio and explore the files in the project. When developing you will use the uzem (the Uzebox emulator) a lot so it's good to set it up so it can be called quickly. Head over the wiki and read this article on how to invoke uzem from AVRStudio. Press F7 to compile and you should get a succesful build:
Image
Click the launch emulator button you created previously and uzem will run your game:
Image
Congrats! Next time we will look in little more details at the source code and create the graphics for our game and convert them using the Uzebox tooling in order to be consumed by our game.
Attachments
FrogsAndFlies-basic-project.zip
(6.47 KiB) Downloaded 830 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Sorry for the slow progress! Things are not going as I would like, *that* machine (my 3d printer) is slowing me down. :lol: The thing that struck me is that we don't have an official and easy tool for doing graphics. My Photoshop way is anything but newbie friendly and ultimately, that's putting a brake on my initiative. Perhaps it's time we add a tools section to the compo!?!
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by nicksen782 »

Actually, I was working on a tool for converting maps to work with SD cards. Uze, would you like to take a look?
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Sure, send it :)
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial - How to make Frogs and Flies!

Post by D3thAdd3r »

Not an intentional side track here, but you are going mode 3 route on this? Every time I see a 2600 game, I first try to think it out in mode 3, then every time decide I shouldn't have given up on that RLE mode(or CunningFellow should have finished his).
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Yes it's mode 3, but I improved the graphics "a bit". I'n fact here's what I had so far...
tutorial-2.png
tutorial-2.png (6.91 KiB) Viewed 15761 times
If some what to express their artistic side and contribute the sprites, the game would surely progress faster. ;)
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial - How to make Frogs and Flies!

Post by D3thAdd3r »

If someone makes some from scratch forget these. Otherwise these are from Charles Doty, modified a tad for Uzebox, from a SegaCd homebrew game that seem to fit well.
Attachments
frogspriteproposition.png
frogspriteproposition.png (17.87 KiB) Viewed 15726 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial - How to make Frogs and Flies!

Post by uze6666 »

Excellent sprites, I love them! Eh, I have no excuse to not finish the game now I guess. Would indeed be more productive than watching an 8 hours 3D print build layer per layer. :lol:
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial - How to make Frogs and Flies!

Post by D3thAdd3r »

*Bump*

Just wondering if there is any progress an this or if you have some tasks to disperse down to the members. I'm eager to see this one done 8-)
Post Reply