Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Collaborators for Allegro Demo Game Competition?

This thread is locked; no one can reply to it. rss feed Print
Collaborators for Allegro Demo Game Competition?
Goodbytes
Member #448
June 2000
avatar

You can alternatively use load_bmp instead of load_bitmap and be able to drop the .bmp extension in your datafile; but again, be sure to grab the bitmap as binary data and not a BMP datafile object.

This is a slightly unusual way to load data from a datafile, as the "usual" way to to it is using the built-in Allegro datafile object types; maybe it would be better for the newbies to use those built-in types.


--
~Goodbytes

Elias
Member #358
May 2000

Definitely, if datafiles are to be used, then only load_datafile should be used. The # syntax is more or less a hack, since we didn't include that index patch posted on [AD] a while back for 4.2.

--
"Either help out or stop whining" - Evert

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Definitely, if datafiles are to be used, then only load_datafile should be used.

I prefer using the # syntax. Problem with load_datafile is that it loads all the objects into memory, and it's not very easy to open individual objects. Plus, if you use thing like PNG and Ogg and whatnot, it becomes an unnecessary burden to load them, convert them if needed, and leave them loaded when you no longer need them.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Elias
Member #358
May 2000

Yes, of course, the # form is nice. It's just the implementation which isn't so good right now (loading a single object with # takes about as long as loading the whole datafile, disk-access wise). What we would need would be an index with the offsets to the individual objects, so only the index would need to be read, and then fseek could be used.

--
"Either help out or stop whining" - Evert

Thomas Harte
Member #33
April 2000
avatar

I found one prima facie error in my code, which was that I was directly comparing a floating point result of an sqrt to zero in order to avoiding a later divide by it becoming nan. Obviously you shouldn't compare floats to exact values anyway, but in any case I've changed it to test for less than 1 as I can afford to be more cutting on that front.

I've also chucked all of the game resources that are expected to survive until the end into datafiles.

Latest everything is attached. It dumps some stuff to stdout while parsing the level so that if Elias's errors persist (they are consistent with a potential result of the bug explained above) I can bug hunt more properly. Included is stdout.txt which is the output of my machine.

Please please please test this!

EDIT: have just now realised that like an idiot I have no overarching acquire/release_bitmap for my level draw! Please no nasty comments about speed for now...

EDIT2:

Quote:

This is a slightly unusual way to load data from a datafile, as the "usual" way to to it is using the built-in Allegro datafile object types; maybe it would be better for the newbies to use those built-in types.

I'm using #. As I understand it, once you've load_datafile'd you index an array of data objects using integers that you obtain from a header file spit out by the grabber. This would mean that the game had to know about all the materials that may exist before it is run and tie art creation to programming to such a degree that I am unwilling to do it.

Elias
Member #358
May 2000

No change here. Output attached.

Oh, and please rename your shutdown function, shutdown is a libc function.

[Edit:] And I think, best to not use datafiles at all then.. as Shawn said himself on this issue, they are really only useful when loaded all at once into memory. (After 4.3.x this will be changed by the indexing patch.. but for now the demo should just use load_bitmap, or show the intended way.)

--
"Either help out or stop whining" - Evert

Thomas Harte
Member #33
April 2000
avatar

Quote:

Oh, and please rename your shutdown function, shutdown is a libc function.

That's one of miran's! I'll fix it.

Quote:

No change here. Output attached

I was able to replicate the bug on my own machine (using a slightly different geometry) and have now properly fixed it. The problem is that edge stripping is really edge vertex stripping and a fundamental assumption of the code is that all vertices are part of at most two (collidable) edges. The error was that when a vertex was removed, both of the edges that were joined to it end up with the same start and end point - i.e. they become the same edge. But the old code wasn't succeeding in removing either. Hence it starts to look as though more than two edges meet at a vertex and things go wrong.

As I say, all solved now.

Quote:

[Edit:] And I think, best to not use datafiles at all then..

On the contrary, there is one datafile that is statically loaded in the way you would like and another that is read 'item by item' as necessary by load_bmp. Surely as an example program it is good to show both ways of doing things?

While I'm on the topic of good practice, at the minute the code has a hard coded list of allowed screen resolutions. I'm aware there is a function that returns a list of available modes but it requires an actual driver (i.e. a platform specific) to be passed rather than a dummy one. Is there any way to get a list of available drivers and if possible their attributes as far as which dummy driver they would fall into? I can see absolutely no use for the mode list function otherwise but I can't find anything in the docs.

Evert
Member #794
November 2000
avatar

Quote:

Is there any way to get a list of available drivers and if possible their attributes as far as which dummy driver they would fall into?

Afraid not. With the current setup, there's no way to know what a driver can do until you've installed it.
Obviously, that's something we'll want to fix in the future.

On the other hand, you could see how the GUI mode selector handles this problem. If I recall correctly, it will only list supported resolutions. It probably just uses the platform-specific driver list though.

Thomas Harte
Member #33
April 2000
avatar

Okay. So I'll put that on the list of Allegro features I find useless!

Attached is source that should have the problems that have been occuring recently fixed. It also has a degree of resolution indpendence but at the the minute it makes an incomplete attempt to scale the physics, as a quick fix. In particular, returning to the menu then switching resolution and continuing game usually causes the player to fall through any platform he's on and the gravity and air resistance aren't scaled. That doesn't matter because the physics won't be 'scaled' in the end - but it provided a useful way to test the edge clipping.

Allegro's lack of subpixel accuracy on scaled bitmaps is also painfully evident.

Anyway, I hope it works okay.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Okay. So I'll put that on the list of Allegro features I find useless!

Very constructive ::) Might want to stick with the coding...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Richard Phipps
Member #1,632
November 2001
avatar

How's the actual game coming along? Isn't there some kind of time limit for this competition?

Elias
Member #358
May 2000

Quote:

Allegro's lack of subpixel accuracy on scaled bitmaps is also painfully evident.

Well, as you know, Allegro 4.2 without AllegroGL is mainly meant to be used with non-scaled/rotated bitmaps - but I think that's what makes your game a great demo.. the same demo, when run with 4.3.x, will work much better, with anti-aliased, OpenGL drawn polygons and sprites :)

Oh, and I updated the blender exporter a bit, I'll post it together with a bigger test level later (or tomorrow). About the edge stuff, I think I'll do this:

"collidable" will be per-mesh in Blender
"edge" will be set on all mesh-boundary edges, not on others
"edge height" will be set on a per-mesh base as well, and be 0 on all edges not marked "edge"

I think that's about as good as I can get it to work in Blender.

--
"Either help out or stop whining" - Evert

Goodbytes
Member #448
June 2000
avatar

Quote:

Well, as you know, Allegro 4.2 without AllegroGL is mainly meant to be used with non-scaled/rotated bitmaps - but I think that's what makes your game a great demo.. the same demo, when run with 4.3.x, will work much better, with anti-aliased, OpenGL drawn polygons and sprites :)

Whoa, whoa... what? You're not saying that Allegro 4.3 will use OpenGL as a driver... are you? . . . don't phunk with me . . .


--
~Goodbytes

Thomas Fjellstrom
Member #476
June 2000
avatar

It does now with AllegroGL, to some degree. AllegroGL is a wanted addition, its just not finished yet.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Goodbytes
Member #448
June 2000
avatar

Compiling the newest source provided by Thomas Harte:

about_menu.c:22: initializer element is not constant
about_menu.c:22: (near initialization for `menu[7].name')
about_menu.c:22: initializer element is not constant
about_menu.c:22: (near initialization for `menu[7]')
about_menu.c:23: initializer element is not constant
about_menu.c:23: (near initialization for `menu[8]')
about_menu.c:24: initializer element is not constant
about_menu.c:24: (near initialization for `menu[9]')
about_menu.c:25: initializer element is not constant
about_menu.c:25: (near initialization for `menu[10]')
about_menu.c:26: initializer element is not constant
about_menu.c:26: (near initialization for `menu[11]')
about_menu.c:27: initializer element is not constant
about_menu.c:27: (near initialization for `menu[12]')
about_menu.c:28: initializer element is not constant
about_menu.c:28: (near initialization for `menu[13]')
about_menu.c:29: initializer element is not constant
about_menu.c:29: (near initialization for `menu[14]')

The compiler (MinGW; gcc version 3.2) seems not to like allegro_id in line 22 of about_menu.c:

{ demo_text_proc, allegro_id, 0, 0, 0, 0 },

Replacing allegro_id with a string literal fixes the problem.

By the way--it's "Goodbytes," not "Goodbyte." I thank you for putting my name in the credits; hopefully I'll have something more to show for it soon ;)

[EDIT]
Uh-oh... I fell through a wall. I attached a screenshot of where it happens... this results from just running back & forth and picking up speed - when the character reaches that point in the wall, he falls through. This is a very repeatable bug... it's not supposed to happen, is it?

[EDIT2]
It seems to happen right at the point where the track becomes fully vertical on the left side.


--
~Goodbytes

Thomas Harte
Member #33
April 2000
avatar

Quote:

Very constructive

As I already said, this would only be helpful if there were some way to obtain a list of drivers as well as at least learning which are full screen and which are not. That sounds like constructive criticism to me.

Quote:

By the way--it's "Goodbytes," not "Goodbyte." I thank you for putting my name in the credits; hopefully I'll have something more to show for it soon

Oh, yeah. I keep noticing that and making a mental note to fix it. I'm definitely sure I'll do it almost any minute now.

Quote:

Uh-oh... I fell through a wall. I attached a screenshot of where it happens... this results from just running back & forth and picking up speed - when the character reaches that point in the wall, he falls through. This is a very repeatable bug... it's not supposed to happen, is it?

No, and it doesn't ever happen for me on my PowerPC. I'm starting to get incredibly annoyed by it though as every 'fix' seems not to fix it and of course I can't test the stupid thing myself.

I'll work on some sort of logging system that allows me to track what is going on.

Thomas Fjellstrom
Member #476
June 2000
avatar

Sounded like a useless complaint to me.

edit: See, it may have been what some call "Constructive Criticism", but just how constructive was it? What did it accomplish? The devs KNOW we need stuff like that, but currently (as you are fully aware of), allegro's underlying system doesn't support it. The feature you want will likely be in 4.3, but who knows, it probably wont be if all we get is "constructive criticism".

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Thomas Harte
Member #33
April 2000
avatar

It does if you misquote it. The entire conversation looks quite different:

Thomas Harte said:

While I'm on the topic of good practice, at the minute the code has a hard coded list of allowed screen resolutions. I'm aware there is a function that returns a list of available modes but it requires an actual driver (i.e. a platform specific) to be passed rather than a dummy one. Is there any way to get a list of available drivers and if possible their attributes as far as which dummy driver they would fall into? I can see absolutely no use for the mode list function otherwise but I can't find anything in the docs.

Evert said:

Afraid not. With the current setup, there's no way to know what a driver can do until you've installed it.
Obviously, that's something we'll want to fix in the future.

Thomas Harte said:

Okay. So I'll put that on the list of Allegro features I find useless!

Looks to me like a mere acknoledgement of Evert's answer that turns my earlier comment into constructive advice.

EDIT:

Goodbytes said:

It seems to happen right at the point where the track becomes fully vertical on the left side.

Cool. I'll focus on the tests that check the extent of line segments (as contrasted with infinite lines). Until now I've been concerned that its a rounding error to do with the 'one way' collisions system (i.e. the necessary capacity to jump 'in front' of a platform and then stand on it, which people expect to be able to do)

Thomas Fjellstrom
Member #476
June 2000
avatar

read my edit, and note that I place that last quote of yours on the same level of "usefullness".

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Thomas Harte
Member #33
April 2000
avatar

Quote:

See, it may have been what some call "Constructive Criticism", but just how constructive was it? What did it accomplish? The devs KNOW we need stuff like that, but currently (as you are fully aware of), allegro's underlying system doesn't support it.

Firstly I don't consider whether criticism has been raised before or is popularly known to be determinative of whether it is constructive. Secondly, I don't understand how the code seems to know which drivers are full screen or not when the user uses GFX_AUTODETECT_FULLSCREEN but apparently couldn't when providing a list of available drivers. Thirdly, I don't think either of us want to seriously divert this thread in this direction!

Evert
Member #794
November 2000
avatar

Quote:

Firstly I don't consider whether criticism has been raised before or is popularly known to be determinative of whether it is constructive.

Certainly. By all means, remind us of things that need to be done. It helps keep our list of priorities straight (even if it can be annoying at times ;))

Quote:

Secondly, I don't understand how the code seems to know which drivers are full screen or not when the user uses GFX_AUTODETECT_FULLSCREEN but apparently couldn't when providing a list of available drivers.

There's a drv->windowed flag in the gfx driver struct. Again, you need to figure out how what drivers are available.
There actually is a way to do this, but you probably shouldn't do this in a demo game as it involves some of Allegro's internals that shouldn't be exposed. It's more or less like this (code adapted from set_gfx_mode, but untested):

1#include <allegro.h>
2#include <allegro/internal/aintern.h>
3 
4_DRIVER_INFO *driver_list;
5GFX_MODE_LIST *modelist;
6int c, n;
7 
8if (system_driver->gfx_drivers)
9 driver_list = system_driver->gfx_drivers();
10else
11 driver_list = _gfx_driver_list;
12 
13for (c=0; driver_list[c].driver; c++) {
14 modelist = get_gfx_mode_list(driver_list[c].id);
15 for (n=0; n<modelist->num_modes; n++) {
16 /* do stuff with modelist->mode[n] */
17 }
18 destroy_gfx_mode_list(modelist);
19}

The modelist contains information about width, height and colour depths. The driver has a `windowed' field that indicates wether it is a windowed or fullscreen mode driver.

So it's possible to get this information, but once again, I don't recommend it for a demo game.

Elias
Member #358
May 2000

We could simply document some of the public drivers, system_driver already has no underscore, so is a public API symbol.. so a simple docs patch (only mentioning the gfx_drivers member) might fix this.. (didn't think much about it though)

--
"Either help out or stop whining" - Evert

Evert
Member #794
November 2000
avatar

No, I don't think we want to expose the contents of the system driver. If we want to do this, the proper way to do it is through a documented API function - which it's too late to add to 4.2 right now.

Carrus85
Member #2,633
August 2002
avatar

So, how exactly is the development going to continue after 4.2 comes out (non-RC or beta)? Are we going to maintain compatability for the same functions up until 5.0 (Implying that version 4.9 would be the first major API break)? Or are we going to simply maintain compatability with the current version forever? Or are we going to simply going to phase new API changes into the branch and drop them at 5.0? Or are we going to phase new API changes into the branch and leave the older code behind? How exactly is development going to continue beyond 4.2? ???

Just to satisfy my curiosity...

Goodbytes
Member #448
June 2000
avatar

To whom it may concern (probably Thomas ;)):
I've been playing around with some music... do you like the 'feel' of the 30 second clip I've attached? If I end up making some music for this thing, I don't want it to suck, so give me an honest opinion. :-X

The melody will probably change, it's just something I threw in for now...

[EDIT] I should have mentioned, Thomas - I fall through that vertical wall even when jumping to it from the opposite wall of the half-pipe; so I pass through it regardless of how I approach it. It's as if the edge isn't even there...


--
~Goodbytes



Go to: