How to animate object in GapiDraw and set Timer/Delay?
Hi There,
I'm studying GapiDraw 2.xx and I want to know how can I implement animation:
1. What is the appropriate function to use in animating object, blt, bltfast etc?
2. How can I set a delay that won't affect the speed of any ppc when my programs run?
3. If possible can you paste a simple sample code so as for others too.
The case is I want to make a walking person with only two (2) images to move.
Thanks.
** GR Moore its me again, regards. ***
check out
www.gapidraw.com there is an outline of every function availible.
Personally I put all the frames on a single surface and move the source rect around to create animations. I know there is also built in sprite functions but I am not familar with them.
For the timer thing, there is a built in timer for gapidraw to limit the framerate. If you want to let the framerate run free while limiting other parts, you could use getTickCount() to find the current amout of time in milliseconds that have passed.
Hiya Denthor,
Take a look at my other posts in this forum - I discussed animation systems and the use of timers to keep the animations isolated from system speed.
In regards to your specific questions:
1) If you are rotating a single image (or series of images) you'll want to use CGapiSurface::Blt to make use of the rotation effects. If you have a series of images that are pre-rotated (like a car rendered in 8 different directions) you'll want to use CGapiSurface::BltFast.
2) Base your animations on time (obviously) rather than framerate of the system. On slower systems, your animation will 'skip' frames to keep up (sometimes ugly, but there are workarounds), and will run smoothly on much faster systems.
3) I've developed a really nice sprite engine for our products. Its not too hard to do, it just requires some research and decision making before you get started on it.
As for making a walking person with 2 frames of animation, you'll likely want to increase that to at least 5 frames of animation to make it smooth.
Rotation is great for overhead/side view platform games as it allows you to get the most bang for the least amount of graphics resources. Take a look at the JoJoSoft GapiDraw demo for a nice example of rotations and color manipulations using a single image. -- GR
Thanks GR. Btw, which thread are you referring too? It's too broad to search.
Can you recommend any sample code?
I think there is more than one thread, but this one might help get you started:
[url]
http://forums.pocketmatrix.com/viewtopi ... highlight=
[/url]
I create a new surface, and a temporary surface.
Do all my colorise / tint etc. onto the temp surface
Then do all my rotations / scales onto the new surface.
delete the temporary surface
then use BltFast through out.
Hi GR, question for you:
In your post from Sat Jun 07 you wrote:
3) I've developed a really nice sprite engine for our products. Its not too hard to do, it just requires some research and decision making before you get started on it.
And in another thread I've seen a similar remark from you.
Could you be a bit more specific on this, like what kind of research is needed, and decisions about what have to be made (without spilling your company secrets

) ?
I'm doubting whether to write my own sprite engine and graphic controls library or possibly use the XPE (see thread:
http://www.pocketmatrix.com/forums/viewtopic.php?t=11927), but I don't really want to depend on another library from somebody else (and be dependant if changes to GD are incorporated fast enough).
But I need just a little push to get me started in the right direction for my sprite engine...

Honestly, sprite engines aren't rocket science, they just require some research and planning to get everything working efficiently. The biggest issue is the research - almost everyone is so focused on 3D engines, that 2D has fallen by the wayside and reference material is becoming much harder to locate, both in print and on the web.
Since I've been doing 2D for years, I have a ton of old game development books laying around for reference. If you don't have a good library of older dev books, you might want to consider either scouring Ebay or possibly used bookshops in your area.
On the web you should search for sprite engines, isometric engines and 2D development. You likely won't find exactly what you need, but you'll find enough bits and pieces to gain a solid understanding of what is needed for a working sprite engine.
As an overview, a sprite engine handles the drawing of an unlimited number of sprites, as well as handling collision interactions and physics. This could be as simple as creating a linked list of sprites that are traversed every cycle.
You'll probably want to consider each sprite as a series of n-frames of animation. This means you could have a sprite with 1 frame of animation (a static image) or 100 frames of animation (a very smooth animation). This animation could process forward or backward, could be looping or bidirectional, or could simply be a single pass animation (such as a door opening). Each frame would process in a certain time frame, and you may want to consider skipping frames on slower devices if required. You may want to blt each frame individually, or possibly overlapping frames to create a motion-blur effect. Your animations could utilize simple transparency or more sophisticated blending techniques.
There's much, much more you could do, and you can make a sprite engine as simple or as complex as you like. It could be somewhat generic, or could be specific to your application.
Hope this helped a bit...
Hi GR,
What do you call your engine for Warlords? It is 3D or 2D and I think it would be cool to put your engine a name
How about starcraft,warcraft and diablo (old version) do you classify it as 2d or 3d engines?
Regards.
The Warlords II code isn't ours, it is actually Infinite Interactive's (SSG) code that we're porting. All of the drawing and file i/o code is ours, as well as most of the graphics though. Warlords is fully 2D.
Starcraft is all 3D I believe, Total Annihilation was half 2D - half 3D, Warcraft (I and II) were 2D. Not sure about Diablo as I never really looked at it much.
Starcraft is all 2D, not 3D.
It appears to use isometric tiles, which you will notice if you use the map editor. But underneath all that, it actually uses square tiles 32x32 pixels. You can see these with a third-party editor for the file formats.
IIRC, Starcraft began development with the engine from Warcraft II, but midway through development, switched to the engine from Diablo.
I got addictive with this Starcraft game esp Battle Net. I wish someone will port this game too for Pocket PC.
If no one does, I might hehehe

Just a thought.
I spent a bit of time a few months ago trying to figure out StarCraft's file formats... the areas left over after the rest is documented in all the places on the net, of course. There's some weird bits in the map files I couldn't quite figure out.
Blizzard apparently isn't working on a port, according to one employee I asked. They're likely too busy working on online projects. There was a free clone called FreeCraft, but Blizzard had it shut down a few months ago.
Your best bet would be to port FreeCraft to Pocket PC. You could probably find the source code easily enough, but you'd eventually come up on Blizzard's radar and I imagine they'd squash you.
Yap, it's hard to develop a developed game. I guess the solution is to CLONE them

I'm not much of a fan of the FreeCraft, FreeCiv and similar projects - to me they are nothing more than an attempt to reverse engineer someone elses work (but thats not the topic here, and one that doesn't belong in the GapiDraw forum).
If you want to produce an authorized ppc port of a product:
a) do market research concerning the viability of the product
b) formulate a solid business plan focusing on the product
c) have extensive industry experience and proven success in bringing products to various platforms
d) contact the owners of the license in a professional, business-like manner and present a compelling reason for them to authorize the port
e) negotiate a win-win contract for the license
There's nearly as much work involved in acquiring a license as there is in porting the project over. Then there's the port itself - working with someone elses code that is usually years old, may be poorly documented, or requires non-existant 3rd party libraries. If you're not working on the project full-time, you'll never meet your contractual obligations and that license will be wasted.
Hi ppcStudios,
Are the above steps what you did to get the Warlords contract?
ppcStudios wrote:a) do market research concerning the viability of the product
I'd be pretty interested to know how you went about this, or if you could explain the general procedure to do this.
I'm trying to assert the possibility of starting a new project, but I'm having a hard time finding out how people will accept the concept/game. Since it's a rather big project, I don't want to invest large amount of time into something that would simply not work at all.
And doing that type of market research is something that we don't have much experience in...
Thanks,
--Eric
Eric,
That's basically the steps needed to secure a license, and for the most part the steps I took to secure the Warlords franchise (that and the fact that Steve Fawkner is a great guy to work with).
Market research can be as simple or as complex as you want to make it. Certainly the more detail you extract from your research, the more convincing your proposal will be. For the most part you will be gathering numerical data and attempting to extrapolate the feasability of bringing a title to the ppc marketplace.
This research data could come from published studies, demographics info, sales data of similar titles or even ad-hoc surveys of your current customers. You are trying to find a correlation between the acquired data and potential sales figures of the ported title.
There are many places to locate the needed data - old magazine articles (especially old gaming magazines that publish sales figures of the titles you are interested in), ppc manufacturer demographics info, gaming industry demographics, shareware sales info, Handango/PocketGear/etc sales and download figures... there's a wealth of information available, its just a matter of knowing what to search for, and how to turn that information into usable data.
Market research can seem like a daunting task at first, but it gets easier once you have done it a time or two.
A tip for anyone looking to acquire a license to an existing project - if you're not serious about devoting your full time and attention to the project its best to leave the license to someone else. It's not easy working with someone elses code and media resources, and it will almost invariably be harder than you first anticipated.
Hi GR,
Since we don't have the power like you to get into a franchise

Do you think cloning of the big games will work? And are there any legal issues that may arise?
Thanks.
There's nothing wrong with creating a clone. The only time it becomes an issue is when you are using someone elses copyrighted or trademarked resources (ie product name, code or media resources). For instance, you would likely have legal problems creating a WarCraft clone using the original artwork (or even selling the title and instructing the users that they need to have the WarCraft artwork to play it).
denthorq: There is nothing wrong in cloning a game but focus not just in copying the exact game but getting its general idea and creating a whole set of gameplay enhancements and innovations from that. Old games are great to clone because they usually have more room for improvements not only on the technical side but in the gameplay department as well.
ppcstudios: Thank you for those tips. It's very inspiring especially that I just quit my day-job to go full time in game development.
efortier: If you're looking for a new project. Drop me an email. I think I may have a nice game idea that will click. ;)
Erick and Eric, glad to help. I did game development part-time for several years under the moniker of GrimmWare. While I enjoyed both the freedom of developing my own titles and the security of a full time job, I felt the experience was lacking because I wasn't fully committed to it. When I founded PocketPC Studios I decided to dedicate myself fully to the company and I'm very glad to have done so. ppcstudios has been a resounding success and I very much look forward to seeing it progress even further, both in developing new titles and publishing other developers works. Every day is a new challenge and a new opportunity!
Hi GR, I guess PPC Studio is well funded

If you need help contact us hehe
Hi Erick, Yap I think that's the best idea, twisting the gameplay like what I did with Stratego and GOTG.
Goodluck to your ideas.
I'm also a recent full-time independent Pocket PC programmer. I'm using my opportunity of parental leave to work on my house and make my first game. I have what I believe to be a unique concept, but I'm not sure if it will work. Once the code is done I'll see if it sells a copy or two.
I won't be going back to my day job, since the bioinformatics startup I was working at was liquidated. We did software for data mining in results from genetic analysis. Pretty cool stuff, I got to do some machine learning.
egarayblas, what is your game, like a sort of SimTower or SimApartmentBuilding?
ppcStudios: Thanks a lot! There is one license I covet to no extent, and I prefer to wait and build more experience before I approach the company with this.
May I again peek in your business and ask how the license turned out in regards to money? Did they ask for a specific percentage on sales, a fixed sum of money, both or something else?
Forgive my "nosiness", but you landed a pretty nice deal and I'm sure lots of us are pretty envious!
--Eric
I'm really not at liberty to discuss contract details, but I can provide you with some pretty typical facts and figures.
Most porting contracts will involve paying the licenser a percentage of gross sales (royalty) after returns. This would usually range anywhere from 10% to 75% depending on how much work is required to port the application among other factors. You, the licensee would retain the remainder of that percentage. The licensee would also have other contractual obligations to consider that may affect the percentage - support, advertising, future product considerations, etc.
Up front payments by the potential licensee may be required if the licenser doesn't feel the product will be brought to market within a reasonable time frame. They may also institute a rigid time table within the contract that will void the license if the licensee's obligations aren't met. The licenser certainly wouldn't want provide an exclusive license to a licensee that has no intention of bringing the product to market.
Contract negotiations are an eyeopener, and you really need to be careful what you sign into. Hire a lawyer with experience in software contracts, or learn to scrutinize every word of a contract. I do all of my own contract negotiations, but I've been doing them for alot of years so I'm pretty good at making them a win-win situation.
Denthorq:
I guess PPC Studio is well funded
PocketPC Studios is wholly self-funded through product sales, publishing of 3rd party titles and consulting contracts. Don't let the nay-sayers get you down, it
is possible to create a profitable business that specializes in ppc development.
ppcstudios: I agree. There is a solid business in ppc sw development. I did almost 2 years of part-time ppc game dev before I went full time. It gives me more fulfillment not only because I'm doing games, but I have complete control over every aspect of my life now. :) My goal now is make eSoft Interactive a full-pledged SW company. :)
mlepage: Yes it is a SimTower clone as what most people say and I do admit it too. But once you play it, you'll see a different variation of gameplay. We've packed a couple of game enhancers that deviates it from the original. Is there a game called SimApartment? I haven't heard of this before.
Isn't SimApartment when you rent a room in your parent's house?

Good thing you're renting a room... How about SimGarage? I'm thinking of having a small office room in our garage... (just for me)
denthorq wrote:
Good thing you're renting a room... How about SimGarage? I'm thinking of having a small office room in our garage... (just for me)
Lol. That's exactly what I'm doing now. :)
ppcStudios: Thanks a lot for all that information! This is valuable stuff!
--Eric