PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

PocketFrog update

Hi,

I'm currently in the process of deciding wether I'll use PocketHAL or GapiDraw for my next project, and I was wondering if the PocketFrog update to support PocketHAL will be released soon.

Thanks!

--Eric
If you are planning to use your own renderer ( a special purpose blitter or something like that ) then HAL is the way to go.
If you are happy with GapiDraw built in set of blitting functions (alpha, colorize etc) then there is no contest - GapiDraw has everything you need.

The basic issue , at least for me, was the fact that GapiDraw uses prerorated buffers which means trying to access memory using your own code is quite problematic (slow) - you need to either use slow code or write multiple custom blitter for all possible rotations.
With HAL there is no issue like that - nothing is prerotated.
My game will work in landscape mode only and is in 2D. I know GapiDraw very well, but I never used PocketFrog/HAL.

If we take out the compatibility issue out of the picture (I think PocketHAL works on all ARM PocketPCs, right?), my main concern is about license and the fact that GapiDraw's price is increasing all the time. I've heard about the price for a site license for GapiDraw, and there's no way in hell we're paying that amount of cash for it...

I'm getting real tired of all the changes GapiDraw goes through right now, even if they are warranted/needed/whatever. I want another alternative. Since I like to be in control, PocketHAL seems like the way to go, even for non-3D stuff.

Anyway. Before commiting I wanted to know when PocketFrog was to be updated/released.

Thanks!

--Eric
Efortier:

1) I wanted to update PocketHAL and PocketFrog last weekend but was unable to do so. Hopefully this will be done next weekend. At least the PocketHAL one.

2) License for PocketHAL is you can use it as-is for whatever you want. My intention is to setup a paypal account for donations. You will never be required to donate anything, but if you do, you will get a PocketHAL build without the banner. Note that this banner is really non-intrusive (it is not a splashcreen and only occupies a few row of pixels at the bottom of the display).
Thierry wrote:Efortier:
You will never be required to donate anything, but if you do, you will get a PocketHAL build without the banner.


Very good decision Thierry :)
Is the next version going to be compatible with eVC++ 4.0?

:?:
Anonymous wrote:Is the next version going to be compatible with eVC++ 4.0?

:?:


Why not? The current version is...
I cannot get 0.6.0 to compile at all in version eVC++ 4.0. with or without the STLport-4.5.3

Do you have documentation on how to re-create the project and then dump in the files? Maybe this should be on a new thread...

:roll:
http://pocketfrog.droneship.com/install.html
http://pocketfrog.droneship.com/FAQ.html
http://www.sundialsoft.freeserve.co.uk/pocket_frog.htm

If this doesn't help, then please tell us what kind of problem your have. Log files, etc.

This place is as good as any other.
Will the new PocketFrog library also use stlport?

I know lots of people can't live without stl, but I stay as far from it (and MFC) as I possibly can!

--Eric

I know lots of people can't live without stl, but I stay as far from it (and MFC) as I possibly can!


Curious.. why? I can't think of any logical reason to not use it.
wyrd wrote:Curious.. why? I can't think of any logical reason to not use it.

The less third-party code I use, the easiest the debugging. I would never trust any code not to fail, even if it has been used by zillions of people like stl.

I prefer writing my own templates, like dynamic lists, instead of using someone else's. Yes, I know. I'm reinventing the wheel.

Don't mind me, I'm weird by nature ;)

--Eric
Sure, PocketFrog needs STL to compile, but once you have the .lib file, you don't need to ever use STL again.

I don't use STL for anything in any of my released games.

If you do decide to go with PF, you won't be disappointed. It rocks now, even without PocketHAL integrated. Once it has that, I think all it will need is alpha-channel support to be perfect (and I think someone donated an unoptimized version of code that does that).

Keep up the great work, Thierry.

-John
Hi,

For some reason I can't seem to login.. I just wanted to comment on one thing.

GapiDraw's price is increasing all the time


If you are a small/medium sized company you can still choose to pay $0 for GapiDraw. Sure, large companies have to pay some money for the site license. But only if they are a full-time game development company with numerous employees. Have you applied for a 2.05 license yourself?

//Johan
efortier wrote:Will the new PocketFrog library also use stlport?
I know lots of people can't live without stl, but I stay as far from it (and MFC) as I possibly can!


Please never ever put STL and MFC together in a sentence like that. MFC is an antique library whose goal is the fast development of Windows UI applications. STL is a library of generic templates (containers/algorithms).

To say you don't want to use the STL is like saying you don't want to use the "C" library (memcpy, strcpy, rand, sqrt and so on).
Thierry:

How's the state of STL on PPC these days ?

Last time I checked it was pretty heavy and rather memory hungry which is NOT a good thing on PPC where multiple and small memory allocations will basically "wear out" heap and slow down things to a crawl.
warmi wrote:How's the state of STL on PPC these days ?


I am afraid not much as changed... But that's probably a good thing?

warmi wrote:Last time I checked it was pretty heavy and rather memory hungry which is NOT a good thing on PPC where multiple and small memory allocations will basically "wear out" heap and slow down things to a crawl.


The STL doesn't use any memory, that is until you allocate some (container insertion/push_back). You might run into memory fragmentation issues just like you would without using the STL. This problem is not inherent to the STL.

I have no reason to believe STL is worst (or better) on the PPC then on the PC. The STL is a wonderful tool and I encourage everyone to learn about it and form an opinion for himself.

When "C" first came out, people didn't want to use the "C" library... That is memcpy(), strcpy(), and so on. They were afraid the code wasn't optimal and using too much memory. Do you see a pattern here? =)
"The STL doesn't use any memory, that is until you allocate some (container insertion/push_back)."

Yep, this is precisely the problem. Allocating 1000 nodes will result in 1000 memory allocations for the data you want to store in a node and 1000 allocations for nodes itself.
While I can control the data allocation ( have it allocated in one chunk and then "distributed" to different nodes) the nodes itself will cause a problem.
This is the sort of thing that caused tons of of problems for me when using QT Trolltech collection classes (basically faster, leaner and less featured version of STL) on PocketPC and I had to come up with a custom memory allocators etc ....
In other words, while this sort of allocation doesn't matter much on a desktop machine when one is dealing with tons of memory and much better heap management , the way STL handles memory tends to result in defragmentation and overall slowdowns on PocketPCs.

There used to be another issue with STL - namely code bloat resulting from using templates.
Every time you create a specialized version of some sort of container , the compiler ends up generating separate set of code for each one of them.
There are ways to handle this ( internal void* class that does all the work) but STL was using "pure" approach without any space optimizations.
Things like that matter on a device like PPC and this was one of the reasons why STL wasn't included by default with EVC.
Anonymous wrote:Allocating 1000 nodes will result in 1000 memory allocations for the data you want to store in a node and 1000 allocations for nodes itself.


Not so with STLport. It has a node allocator.

Anonymous wrote:In other words, while this sort of allocation doesn't matter much on a desktop machine


Oh but it does just as much. It's just that the scale you are dealing with is different.

Anonymous wrote:when one is dealing with tons of memory and much better heap management , the way STL handles memory tends to result in defragmentation and overall slowdowns on PocketPCs.


Do you have any evidence pointing to less efficient heap management on the PPC?

Anonymous wrote:There used to be another issue with STL - namely code bloat resulting from using templates. Every time you create a specialized version of some sort of container , the compiler ends up generating separate set of code for each one of them.


This is a common misconception about the STL. It doesn't produce more "bloat" then your own implementation. That is if you know what you are doing. Nothing prevents you from explictely using a std::Vector<void*> to store objects. But then again I would argue that storing pointers in a std::vector<> is often wrong in the first place.

Should you use the STL everywhere? Of course not. But I would argue that using it first and then optimizing found bottlenecks will shorten your development time a lot. Writting "optimal" code first is simply silly.
Anonymous wrote:
In other words, while this sort of allocation doesn't matter much on a desktop machine when one is dealing with tons of memory and much better heap management , the way STL handles memory tends to result in defragmentation and overall slowdowns on PocketPCs.


Whoa there pardner. Slow down cowboy.

That truth of that statement depends, as Thierry said, on what you are doing.

Right now I am writing a simple game on Pocket PC. I have plenty of memory available. I will not run out, even using the STL in relatively stupid ways.

In another life I used to write data mining applications for the PC. It didn't matter if a machine had 1GB or more of RAM, it wasn't enough memory. We were using STL there too, and yes we were using it wisely. It's just the scale of the problem was much larger.

So before you compare apples to oranges, you should define your terms.
Here's a quick one that I don't want to post in the main forum to prevent clutter on such small issue.

Is the backbuffer pitch guaranteed to be constant while the game runs?

And using the SWAP_DISCARD, I understand that I must query for the backbuffer on each frame to get the proper pointer to the memory, right?

Thanks!

--Eric
efortier wrote:Is the backbuffer pitch guaranteed to be constant while the game runs?


There is no such guarantee. I don't know of any case where it would happen, but I'd rather left my options open for the future.

efortier wrote:And using the SWAP_DISCARD, I understand that I must query for the backbuffer on each frame to get the proper pointer to the memory, right?


The backbuffer pointer can, and will, change on each frame. So you should not cache it. This is independant of the mode you select.
Gracias mucho!

--Eric
"Do you have any evidence pointing to less efficient heap management on the PPC? "


Well, when writing ZRaid the game was experiencing unexplained slow-downs only on my PPC devices ( on a desktop was working fine.)

I spent hours trying to figure that one out - there was plenty of memory available , everything seemed to be running fine until a certain point where things would just slow down for no apparent reason...
Eventually I tracked it down to a heap management issues. While having couple hundred allocated memory blocks meant nothing on my PC , it was literally killing my Ipaq.
I was using QList and QVector all over the place and reimplementing new/delete to use chunked allocation (1000 or so nodes at a time) fixed everything.

" Nothing prevents you from explictely using a std::Vector<void*> to store objects."

No as safe as Vector<foo>.


Don't get me wrong. I use STL-like library all the time- in fact, I can't imagine writing code without this sort of basic library anymore - it is just STL was designed as a full featured, complete solution rather than a lean and efficient library – something that one would prefer in low-memory/slower devices.
mlepage:

I never said I was running out of memory.
That was the problem - I had plenty of memory available but new/delete was slowing to a crawl because of fragmentation - something that was only visible on a PPC device ( on my desktop machine running the same code with 10 x memory allocated ( and by the same token fragmented) didn't make any difference at all.)

Here is another reference to the issue of crappy heap management on PPC:

Look at the post written by Digby:

http://216.40.216.132/forums/viewtopic. ... 5faf1c8a7d
OK but you can take over memory management of any container in the STL yourself if you wish. So you can still use the STL with your own memory management.
Anytime I use GetClock(), I get an unresolved symbol error. If I comment it out, everything compiles fine.

I tried to use GetModel(), GetPlatform() and GetProcessor() from pockethal.h, but they all work. Just GetClock.

Is this a known problem or am I missing something??

--Eric
efortier wrote:Anytime I use GetClock(), I get an unresolved symbol error. If I comment it out, everything compiles fine.

I tried to use GetModel(), GetPlatform() and GetProcessor() from pockethal.h, but they all work. Just GetClock.

Is this a known problem or am I missing something??


No. I will look into it this weekend, thanks for reporting it.
warmi wrote:mlepage:
I never said I was running out of memory.
That was the problem - I had plenty of memory available but new/delete was slowing to a crawl because of fragmentation - something that was only visible on a PPC device ( on my desktop machine running the same code with 10 x memory allocated ( and by the same token fragmented) didn't make any difference at all.)


Looks like the issue is more cache misses (that are really expensive on the PPC) then heap fragmentation. Hell we had serious heap and cache problems on Homeworld2 and we solved most of them using Loki's fixed memory allocator. We also happen to use multiple heaps to limit the fragmentation.

So it seems to me that the PPC doesn't have more issues then the PC, it's just the bad effects are aggravated (i.e. same issues = bigger deal).

I can see how std::list<> or std::map<> can kill your performances by inefficiently using the cache. But I wouldn't put the blame on the STL. A naive implementation would do the same thing.

I guess what i am saying is that this is not inherently a problem with the STL but more something that needs to be handled anyways. Inserting/deleting nodes in a STL container each frame all the time is simply wrong, be it on the PPC or PC.