Notices


Reply
Thread Tools
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#31
Originally Posted by dgls82 View Post
Bug report: when I start a new game choosing "start with empty board" or "start with random village" the game crashes...
I can reproduce this. I run it under debugger and strace and nothing. But now I tracked it.

When user press button "Start with empty board", it starts generating new board, which takes some 15 seconds without any visibility. So user press also 'Start'-button which then crashes because there are no scenario chosen.

So there are two issues:
A) Start button crashes if no scenario selected:
*Fixed and reported to the upstream: http://developer.berlios.de/bugs/?fu...&group_id=2929

B) Starting empty map should not take so much, or it must be indicated, or dangerous buttons must be disabled.
*"Start with empty board"/"Start with random village" - should look button, not text.
*Why it takes so much time? (src/lincity/init_game.cpp:159)
*Pressing 'start' is not fatal anymore.
 

The Following 5 Users Say Thank You to AapoRantalainen For This Useful Post:
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#32
you could consider splitting the game to two packages, as many other games do that i mean, you could create package "lincity-ng" with size <1mb with file /opt/lincity/games/lincity-ng (that's only executable in the package, amarite?) which depends on package "lincity-ng-data". It's horrible to download almost 40 mb deb file just to get one small updated executable - just a suggestion
 

The Following 5 Users Say Thank You to misiak For This Useful Post:
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#33
Originally Posted by misiak View Post
Don't get me wrong, I know it's not trivial. I've spent 10 minutes to review his changes really quickly and noticed there are only ~10 files which need to be edited (including ones which require only #include<SDL_OpenGL.h> line removal), and I've done some OpenGL ES programming in the past (mainly 1.1, but also some 2.0 including custom far-from-standard shaders), so I may use my free time to code for Maemo again (I was inactive for almost an year now on this platform, I'm sorry, Guys). Aapo - great work, as szopin said I wrote this post simply to ask if you, Aapo, know about any blocks of code (apart from ones mentioned by you in link quoted by me previously) which may relay on getConfig()->useOpenGL check, because you know the code already.


Do you think it's not worth trying? I hate not to use hardware acceleration when it's available and could be used, maybe it would be worth just to put less stress on the cpu and more on gpu? offtopic - could you update OpenTH thread with some information about new releases? The game reached next stage of development, so maybe you could announce it again and advertise more here on TMO? great work javispedro and great thanks - for all your work on entertainment software on Maemo platform!

edit 2 : Oh, forget the CorsixTH part - now I see there was some activity in that thread, I've just missed that.
Sorry, didn't want to sound prickish/dickish, just that many opengl->gles projects die out due to complexity, if you have the knowhow/experience in such porting... pls pls pls take a look at armagetron advanced (halfway (maybe 3/4ths?) there thanks to voodoo): https://code.launchpad.net/~aavoodoo
 

The Following User Says Thank You to szopin For This Useful Post:
jperez2009's Avatar
Posts: 250 | Thanked: 122 times | Joined on May 2009 @ Colorado
#34
Oh WOW! I asked for this quite some time back and it got worked on! You are AWESOME! Thanks for this, tons~
__________________
N900 + GameGripper + Emulators + Kernel Power = <3
Request: NSF/SPC/GBS/USF/PSF/GSF/2SF/Adlib Player or Add-on for N900
 
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#35
ok, stupid question maybe, but i need to ask you, Aapo, as i'm not familiar with "jam"... when i run "./configure" and then "jam", the executable which is produced crashes on my N900 with errors "Warning couldn't find music file... blah blah" and "Unexpected exception: Couldn't open file 'gui/app.xml': No such file or directory" - do i need to run something extra apart from "./configure && jam" ?

edit: ok, nevermind, found in debian/rules that i need a prefix but i'm not deleting the post, as maybe it can help you solve sound issue

And, one more thing - I've seen you have in debian/control, in Build-Depends section, text "libsdl-mixer1.2-dev (>= 1.2.6-5+0m5+ogg+mp3-2)" - this however didn't install this version of sdl-mixer and i was stuck with the old one... i needed to execute "apt-get install libsdl-mixer1.2-dev=1:1.2.6-5+0m5+ogg+mp3-2" to install this package - maybe that has something to do with ogg format not recognized issues?

edit2: after installing the deb from the repos, i have 1.2.6-5+0m5 version of libsdl-mixer1.2, not 1.2.6-5+0m5+ogg+mp3-2...
I've manually downloaded in scratchbox version with ogg:
"apt-get install libsdl-mixer1.2-dev=1:1.2.6-5+0m5+ogg+mp3-2"
and compiled lincity, then copied executable to device, then on device:
"apt-get install libsdl-mixer1.2=1:1.2.6-5+0m5+ogg+mp3-2"
and the error changed to simple "Couldn't open audio: Could not open requested file"... in fact, i think all libsdl-mixer games went silent, but i will check tomorrow, it's too late today for me to think

Last edited by misiak; 2012-04-19 at 00:30.
 

The Following User Says Thank You to misiak For This Useful Post:
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#36
Ok, my phone just needed a restart. Just letting you know, Aapo - after manually installing on my device proper version of sdl-mixer1.2 and installing in my sdk proper version of sdl-mixer1.2-dev, i have music playing in the background So I'm pretty sure it's the case I've described in words:
debian/control, in Build-Depends section, text "libsdl-mixer1.2-dev (>= 1.2.6-5+0m5+ogg+mp3-2)" - this however didn't install this version of sdl-mixer and i was stuck with the old one... i needed to execute "apt-get install libsdl-mixer1.2-dev=1:1.2.6-5+0m5+ogg+mp3-2" to install this package
for music not playing (strangely, sdk thinks that libsdl-mixer1.2-dev 1:1.2.6.5+0m5 is actually >= 1.2.6.5+0m5+ogg+mp3-2...). Please resolve this issue with deb file, so we can hear the music playing in background (maybe try using "=" instead of ">=" ? maybe not elegant solution, but worth a try...) in the meantime, i will start opengl es porting tomorrow, good night to all of you

P.S. Sorry for new post instead of editing old one, but this thread deserves a bump

edit: how do debian build tools compare versions of packages? if it's just string compare, "1:1.2.6.5+0m5" is indeed higher, than "1.2.6.5+0m5+ogg+mp3-2" due to second character from the first string (":") being higher in ascii table than from the second string (".")... I can see you are already setting some packages' version with ":"... maybe "1.2.6.5+0m5+ogg+mp3-2" should be changed to "1:1.2.6.5+0m5+ogg+mp3-2"? I cannot test right now, because my development environment is messed up due to opengl/opengles tests :P

another edit: found that, out of curiosity searched the web and, according to http://www.lucas-nussbaum.net/blog/?p=304 , comment #4, in apt-pkg/deb/debversion.cc - actually it's plain C strcmp() function, so I'm pretty sure I can say I found out why sound is not working

Last edited by misiak; 2012-04-20 at 21:59.
 

The Following 4 Users Say Thank You to misiak For This Useful Post:
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#37
It wasn't that hard, but the performance boost is not that big... On non overclocked device (with power kernel, but with stock speeds), i've made some quick tests, with full sound support (music was playing constantly in the background consuming ~10-15% of cpu via pulseaudio)

70-75% with -s option (SDL rendering)
60-65% without any option (OpenGL ES rendering by default)

I don't want to judge wheather the game and whole device was more responsive or not, because it may be related to my excitement

The rendering logic is not really OpenGL ES friendly, there are lots of calls to drawing pairs of triangles (quads), there is a lot of room for optimizations, which can be done now

In zip you can find compiled executable and a diff of source fetched by "apt-get source lincity-ng". If you feel brave and want to run it before Aapo pushes changes to the repo, you may download the zip, copy file "lincity-ng-opengles" to /opt/lincity/games (you may leave old one untouched, so you will have /opt/lincity/games/lincity-ng and /opt/lincity/games/lincity-ng-opengles), make it executable and run with "/opt/lincity/games/lincity-ng-opengles" command. The game can also be run with "-s" command (lower-case "s", this is important) which makes it ignore my code and use pure SDL rendering.

Aapo, maybe you want to make me a co-maintainer of package, I would like to kill the bug with no sound in packages generaged by autobuilder
Attached Files
File Type: zip lincity.zip (367.7 KB, 70 views)
 

The Following 4 Users Say Thank You to misiak For This Useful Post:
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#38
Awesome work. The sound issue is not related to this package only. Sadly sld-mixer from repos supports only .wavs (check this thread:http://talk.maemo.org/showthread.php?t=81792) so either statically including proper one is needed, or some other gymnastics. Could you by any chance have a look at Armagetron Advanced? With software GL it is close to playable in speed terms and would be awesome multiplayer game for N900 (except for speed everything else works)
http://forums3.armagetronad.net/view...hp?f=4&t=21548 (link to the GLES discussion on upstream forum, sadly devs from there seem to have abandoned the idea)
https://code.launchpad.net/~aavoodoo (link to the close to finished GLES rewrite;opengles iirc is closer, gles2 bit further away)

EDIT: oh and btw, probably worth notifying upstream of your work, doubt they will reject piece of code that widens the possible user-base of their project in such a way (open-pandora, iphones... lots of gles only devices)

Last edited by szopin; 2012-04-21 at 06:24.
 

The Following User Says Thank You to szopin For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#39
@misiak, I merged your code, but not pushed package to the extras-devel:
https://gitorious.org/lincity-n900/l...19a30cfb529cb1

I added
*compiling without GLES
*sdl/gles can be changed via options
*default=sdl

btw: Android Lincity has also some buggy/experimental gles: http://www.nicolasmy.com/projects/57...-of-Lincity-NG

-> Working gles on upstream would be very great. I haven't yet got any comments about my patches, so I'm not sure who is currently lead maintainer of the Lincity. Also wider discussion about playing on touchscreen would be cool.

Last edited by AapoRantalainen; 2012-04-21 at 09:58. Reason: address for merged gles
 

The Following 3 Users Say Thank You to AapoRantalainen For This Useful Post:
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#40
Originally Posted by szopin View Post
Awesome work.
Thank you, but no really, in fact it was a peace of cake...
Originally Posted by szopin View Post
The sound issue is not related to this package only. Sadly sld-mixer from repos supports only .wavs (check this thread:http://talk.maemo.org/showthread.php?t=81792) so either statically including proper one is needed, or some other gymnastics.
I know, I'm aware of it since I bought my N900 in 2009 There is however, in Extras testing, a version which supports more formats ( http://maemo.org/packages/package_in...5+0m5+ogg+mp3/ ), and it didn't uninstall any metapackages or anything on my phone with CSSU stable (someone reported it uninstalls maemo-fremantle-pr or however is this metapackage named) - is it just case of phones with Nokia's PR's?
Originally Posted by szopin View Post
Could you by any chance have a look at Armagetron Advanced? With software GL it is close to playable in speed terms and would be awesome multiplayer game for N900 (except for speed everything else works)
http://forums3.armagetronad.net/view...hp?f=4&t=21548 (link to the GLES discussion on upstream forum, sadly devs from there seem to have abandoned the idea)
https://code.launchpad.net/~aavoodoo (link to the close to finished GLES rewrite;opengles iirc is closer, gles2 bit further away)
Sure, I'll take a look at it during this weekend, but I can't promise I'll make it work. If there is desktop OpenGL rendering engine, I will try to port it to OpenGL ES 1.1 (it's easier for me, I hate writing shaders, etc.)
Originally Posted by szopin View Post
EDIT: oh and btw, probably worth notifying upstream of your work, doubt they will reject piece of code that widens the possible user-base of their project in such a way (open-pandora, iphones... lots of gles only devices)
I know, for upstream the patch dould be better - if you are curious, you may take source code of ubuntu package and replace code in all /src/gui/PainterGL/* classes with my code from /src/gui/PainterGLES classes and it will work... So in fact a better and more proper patch would just update functions in src/gui/PainterGL/* classes and change just a few lines in "main.cpp" and "mk/configure" (and "mk/something", i'm sure i edited two or three files from "mk" directory). Anyway, the code with my patch should be compilable on Pandora AFTER replacing all SDL_gles related calls to their version of SDL_opengl ( SDL_gles library is Maemo-only library and there are few functions which would be not available anywhere else).

Originally Posted by AapoRantalainen View Post
@misiak, I merged your code, but not pushed package to the extras-devel:
https://gitorious.org/lincity-n900/l...19a30cfb529cb1

I added
*compiling without GLES
*sdl/gles can be changed via options
*default=sdl

btw: Android Lincity has also some buggy/experimental gles: http://www.nicolasmy.com/projects/57...-of-Lincity-NG

-> Working gles on upstream would be very great. I haven't yet got any comments about my patches, so I'm not sure who is currently lead maintainer of the Lincity. Also wider discussion about playing on touchscreen would be cool.
You changed default rendering engine to SDL anyway? Ok, the OpenGL can be turned on by using "-g" command line option anyway - I hope you didn't change that
Android Lincity required quite heavy rewrite I guess, as it's different language and must use different libraries...

You know, I've in fact just replaced few OpenGL functions with another ones... My process of porting is:
1. Get your source
2. Restore OpenGL you removed earlier
3. Compile on my ubuntu devel machine
4. It worsk with OpenGL => find in code functions which are in OpenGL but not in OpenGL ES (as OpenGL ES is actually a subset of desktop OpenGL functions)
5. Change this function calls to soething OpenGL ES compatible - but testing is still done on desktop PC, as it is much easier and faster to debug than compiling everything in scratchbox and uploading to my phone...
6. When code is using only OpenGL ES compatible functions - move to maemo scratchbox, replace SDL_opengl initialization/deinitialization and buffer swapping with javispedro's SDL_gles ones (it's really a task for 1-2 minutes, javispedro is the hero here) and adjust compile scripts to use "-lSDL_gles -lGLES_CM" instead of "-lopengl32 -lGL" (also task for only few minutes)

In fact, this whole "port" took me about 3-4 hours overall, including messing up with maemo scratchbox and my ubuntu libraries If Armagetron has working OpenGL rendering engine, it shouldn't take much longer than this to make initial port to OpenGL ES...

Sorry if I made any grammar mistakes which made some sentences unreadable, I have slept really little during past few nights.

Anyone else willing to compare cpu usage on their N900 with SDL and OpenGL ES rendering?

Last edited by misiak; 2012-04-21 at 10:52.
 

The Following 2 Users Say Thank You to misiak For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 05:05.