Beta Galactic Artifact - Release B


YES! Someone just hung the beta server...

Ctrl+C... backtrace...

CODE
Program received signal SIGINT, Interrupt.
0xb7c32f1e in send () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7c32f1e in send () from /lib/tls/libc.so.6
#1 0xb7edd3ac in SDLNet_TCP_Send () from /usr/lib/libSDL_net-1.2.so.0
#2 0x0809f9ff in NetworkConnection::sendMessage ()
#3 0x080a0049 in NetworkConnection::send ()
#4 0x080a24b8 in GameServer::pushMessages ()
#5 0x080aabc3 in startServer ()
#6 0x080ace9a in main ()


Yup, I was right. It's hanging on SDLNet_TCP_Send.

*Happy Dances!*

OK, tonight I re-write this network code to be properly threaded.
 
Trevor Bradley said:
Cheats should be working... Shift-B, F9 are the big ones.
I was on the network game, and didn't know about the Shift-B anyway. I don't like cheating, it makes me dumber.

Trevor Bradley said:
...also test zooming in.. the frame rates DURING the zooming...
Oh, ok. But that scan code is the major hangup. Actually, when you pan a sector, there is a little lag before you can select anything on the new screen, I don't think its a problem with framerate, Ill check it out though.

Trevor Bradley said:
...a 28% variance...
Wait, I'm not sure I understand. Will the artifact be in the center of that? Or in a random location within that radius? Just curious.

Trevor Bradley said:
A$ should exclude 1/81, A$$ should exclude 1/9th.... I'll look into this. Maybe they should be reversed so that A$ was inverse?!? Hmm....
Don't inverse them, that would change the game too much, just make then cut out less appropriately.

Trevor Bradley said:
...random quantity of money with each object...
I've seen that in many games... the quantity will need some working with to get right. However, it might potentially solve the "slow-early-game" dilemma.

And here...
Trevor Bradley said:
...also test zooming in.. the frame rates DURING the zooming...
So I found:
From all zoomed out to:
Sector 1: 20 while zooming in, 33 when done. 20 zooming back out, 33 when done.
(Pretty much the same for Sectors 1, 2, 3, 4, 6, 7, 8, 9)
Sector 5: 13 while zooming in, 33 when done. 20 zooming back out, 33 when done.

Zooming in Going from xx0-0000 to xxx-0000 is 33 fps, but zooming out from xxx-0000 to xx0-0000 takes it down to 20. All zooming in past that, anywhere (anywhere not in 500-0000), is at 33 fps.

At 555-5500 to 555-5550 is 30, but zooming 555-5550 to 555-5500 it goes down to 25 briefly. From 555-5550 to 555-5555 is 33, and zooming back out is 33. Any other zooming in the 500-0000 sector into the center is slower, taking me down to 13, 15, 17, or 20 fps. When I zoom out, it drops a little.

Oh, and a side note, I get 33 FPS at 555-5555 when I'm just looking, and my ship is not there. The logs are:
CODE

Begining Loop 0 Basic Surfaces 0 Galaxy Surface 2 Radar Surface 1 Information Surface 3 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 3 Galaxy Surface 2 Radar Surface 1 Information Surface 3 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 4 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 3 Flip Screen 2 Before Delay 0



And in the red zone, 20 fps:
CODE

Begining Loop 0 Basic Surfaces 2 Galaxy Surface 1 Radar Surface 1 Information Surface 42 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 42 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 2 Galaxy Surface 1 Radar Surface 1 Information Surface 83 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 2 Galaxy Surface 2 Radar Surface 0 Information Surface 89 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 87 Flip Screen 2 Before Delay 0



Hmm, earlier, all that whining I did about the red zone lag. Apparently, the scanner can be far worse, If I'm in the middle of it all...

Hmm, ill check that out, here is the red zone in a place I'd usually collect artifacts in:

275-6555 in the clear zone, just looking, 33 fps:
CODE

Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 19 Information Surface 4 Flip Screen 1 Before Delay 0
Begining Loop 15 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 3 Flip Screen 2 Before Delay 0
Begining Loop 13 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 0 Information Surface 4 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 1 Information Surface 4 Flip Screen 0 Before Delay 0



275-6555 in the clear zone, with level 10 scanner, 33 fps:
CODE

Begining Loop 0 Basic Surfaces 0 Galaxy Surface 1 Radar Surface 51 Information Surface 4 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 42 Information Surface 14 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 8 Information Surface 4 Flip Screen 1 Before Delay 13
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 10 Information Surface 36 Flip Screen 1 Before Delay 0



275-6555 in the clear zone, with level 10 scanner, zoomed out once, 33 fps:
CODE

Begining Loop 0 Basic Surfaces 1 Galaxy Surface 0 Radar Surface 17 Information Surface 3 Flip Screen 4 Before Delay 0
Begining Loop 0 Basic Surfaces 0 Galaxy Surface 1 Radar Surface 14 Information Surface 3 Flip Screen 4 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 0 Radar Surface 12 Information Surface 4 Flip Screen 4 Before Delay 118
Begining Loop 0 Basic Surfaces 2 Galaxy Surface 1 Radar Surface 12 Information Surface 3 Flip Screen 4 Before Delay 0





275-6555 in the red-zone, just looking, 20 fps:
CODE

Begining Loop 0 Basic Surfaces 3 Galaxy Surface 2 Radar Surface 1 Information Surface 41 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 3 Galaxy Surface 2 Radar Surface 1 Information Surface 41 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 3 Galaxy Surface 2 Radar Surface 1 Information Surface 96 Flip Screen 1 Before Delay 1
Begining Loop 0 Basic Surfaces 3 Galaxy Surface 2 Radar Surface 1 Information Surface 90 Flip Screen 2 Before Delay 0



275-6555 in the red-zone, with level 10 scanner, 15 fps:
CODE

Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 18 Information Surface 43 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 17 Information Surface 43 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 2 Radar Surface 17 Information Surface 125 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 2 Galaxy Surface 1 Radar Surface 22 Information Surface 67 Flip Screen 2 Before Delay 0



275-6555 in the red-zone, with level 10 scanner, zoomed out once, 15 fps:
CODE

Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 12 Information Surface 43 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 15 Information Surface 43 Flip Screen 1 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 16 Information Surface 42 Flip Screen 2 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 15 Information Surface 137 Flip Screen 1 Before Delay 0




BOOH YAH! I was right, the red zone is worse for me, cause I never go to the center looking for goodies (too many artifacts are in the way of others, not a good hunt for me, however with the change or the ancient artifacts, maybe all artifacts will be good, then it doesn't matter what I get), so at a nice semi-thick spot where I do go, the red-zone is actually worse of me than my maxed scanner...

So from this we can infer, a red-zone toggle would help some people out (toggle the red-zone on the big map, not the little top-right corner map), but a better scan code would help everyone alot. Keep in mind, that the people that get bad fps in the red-zone, would never touch the center of the galaxy, so making the scan better wouldn't help the slower computers that much.

Edit:
Oh, and by the way, on a less interesting note, when I said:
QUOTE
...there is a little lag before you can select anything on the new screen, I don't think its a problem with framerate, Ill check it out...


As it turns out, during the pan, I get 33 fps, and here is the output:
CODE
Begining Loop 0 Basic Surfaces 0 Galaxy Surface 2 Radar Surface 8 Information Surface 3 Flip Screen 4 Before Delay 0
Begining Loop 0 Basic Surfaces 1 Galaxy Surface 1 Radar Surface 8 Information Surface 4 Flip Screen 4 Before Delay 0
Begining Loop 0 Basic Surfaces 0 Galaxy Surface 2 Radar Surface 9 Information Surface 3 Flip Screen 4 Before Delay 0
Begining Loop 0 Basic Surfaces 0 Galaxy Surface 2 Radar Surface 8 Information Surface 4 Flip Screen 4 Before Delay 0



So is that minor pause is there on purpose? Not that I mind, just curious.


Also I noticed:
Even when I am at 33 fps, the "Before Delay" is always 0, I thought "Before Delay" was a delay to keep it at 33 fps (something like "Sleep();"), shouldn't there be some "Before Delay"? I mean, even at 70% CPU usage, the game has 0 "Before Delay". Just curious, maybe the output is wrong, maybe I'm wrong and the "Before Delay" is something else.

I hope all this is helpful/useful info. If its not, sorry that its so much to read.
 
Last edited by a moderator:
OK, let me try to piece through all this properly...

TheMonkey said:
Oh, ok. But that scan code is the major hangup. Actually, when you pan a sector, there is a little lag before you can select anything on the new screen, I don't think its a problem with framerate, Ill check it out though.
It's deliberate. What's going on is the pan isn't at a constant velocity, so when the pan occurs it takes a short while for it to "snap" into place. I had to do this because if you moved the cursor before the pan was complete all kinds of nastiness would happen with the cursor. It can be tuned. Just whenever I did it looked bad when everything slammed over several pixels.

TheMonkey said:
Trevor Bradley said:
...a 28% variance...
Wait, I'm not sure I understand. Will the artifact be in the center of that? Or in a random location within that radius? Just curious.



It will be a random location within the inner and outer radius. (Techincally no, but I'll avoid getting into a discussion about probability distribution in polar co-ordinates.) So yes, it's random. It will not always be in the center.

TheMonkey said:
Trevor Bradley said:
...also test zooming in.. the frame rates DURING the zooming...
*discussion that zooming drops the fps to 20 min*



That's really good news, actually. Zoom lag was atrocious before, comparable to your radar lag and perhaps worse. There's some tuning to do obviously but I'm glad the work I have put into this has paid off.

TheMonkey said:
Hmm, earlier, all that whining I did about the red zone lag. Apparently, the scanner can be far worse, If I'm in the middle of it all...

Hmm, ill check that out, here is the red zone in a place I'd usually collect artifacts in:

*data proving red zone is laggy*

BOOH YAH! I was right, the red zone is worse for me, cause I never go to the center looking for goodies (too many artifacts are in the way of others, not a good hunt for me, however with the change or the ancient artifacts, maybe all artifacts will be good, then it doesn't matter what I get), so at a nice semi-thick spot where I do go, the red-zone is actually worse of me than my maxed scanner...

I will have to investigate red zone lag then. The weird bit is that I thought I already solved this issue. The information code is supposed to quickly realize if the screen is all red, promote that information to the top of the queue so it shouldn't have to check so much in the future to verify everything is red, and then draw in everything red and then not call that again because the screen doesn't need updating. There should be a bit more lag during panning (as it has to determine if there's new information data), but the promotion of relevant red data is supposed to nip that quickly in the bud. I'm uncertain at the moment if it's the drawing of the red, or the mathematics of "Is it red?" that's slowing things down.

The logical answer is that I've done something dumb causing the information screen to re-render, which means it's worth investigation.

TheMonkey said:
So from this we can infer, a red-zone toggle would help some people out (toggle the red-zone on the big map, not the little top-right corner map), but a better scan code would help everyone alot. Keep in mind, that the people that get bad fps in the red-zone, would never touch the center of the galaxy, so making the scan better wouldn't help the slower computers that much.

OK, I've got two major fps burdens to investigate then:

1) Radar FPS crippling the system fps.
2) "All Red" crippling the system fps.

I'll see if I can tackle those for Release C. AFTER I fix this network code. :)

TheMonkey said:
Also I noticed:
Even when I am at 33 fps, the "Before Delay" is always 0, I thought "Before Delay" was a delay to keep it at 33 fps (something like "Sleep();"), shouldn't there be some "Before Delay"? I mean, even at 70% CPU usage, the game has 0 "Before Delay". Just curious, maybe the output is wrong, maybe I'm wrong and the "Before Delay" is something else.

I hope all this is helpful/useful info. If its not, sorry that its so much to read.



The numbers are actually a number of milliseconds since the last "event". I think the timer is reset just before "Before Delay", so that it's always zero.

The Delay is the delay that those of us with faster computers get to limit our framerates to 33fps. The FrameTimer delay method sleeps for a while if it needs to, but doesn't if it doesn't. Those with fps lower than 33 get no delay.

In other words, it's debug lingo, don't worry about it too much. :)

I appreciate all the testing. It is leading me in the right direction. I just have to be careful not to take on too much for each release.

Left to be done for Release C:
* Properly thread server's (and also client's) network calls.
* Detect Server/Client crash
* Fix industrialist high priced rendering (the 22.5 degrees problem)
* Some more tuning for Ancient Artifact radius.
* Log red area information to a debug file (so that players who say the screen is all red can send the file back to me to verify)
* Seeing if I can help German users get those last few characters on their keyboard working.
* Investigate and Improve Radar fps
* Investigate and Improve "All Red area" fps

On the side, in my head, I'm also trying to figure out a clever mathematical way to allow the player to zoom their cursor to some unexcluded area of the map (in case they can't find one).
 
Last edited by a moderator:
Well, not to be annoying. But I got another idea. Of course what you already have on your plate for the next release looks really good, and I don't want to delay that progress at all...

Before you can get clues from a certain race, you have to go to that race's home-world and sign up, paying a small fee ($200 or whatever sounds fair and a $, $$ or $$$ of their race that they randomly pick) for their assistance in finding the artifact. Then you have the option of "Trade artifact for hint" screen in the menu. Now either a preset home-world for the 3 races, or near Earth's location, or make them random (but a certain distances from each other, so they aren't in the far corners from each other)

This accomplishes the following:
*No starting somewhere near the artifact and winning too early.
*No accidentally saying "yes trade for hint" on accident at the beginning of the game, and wasting the money.
*Slows down the end-game, which is far too easy, compared to the early game.

But release C looks pretty nice right now. Especially if you fix the scan problems.
 
Fun game... I haven't played it much, but when I did I enjoyed it. Got my arse beat in multiplayer... I got a 'babababa' bug when I zoomed out really far away from my ship, and this happened twice.
 
Trevor Bradley said:
Left to be done for Release C:
* Properly thread server's (and also client's) network calls.
* Detect Server/Client crash
* Fix industrialist high priced rendering (the 22.5 degrees problem)
* Some more tuning for Ancient Artifact radius.
* Log red area information to a debug file (so that players who say the screen is all red can send the file back to me to verify)
* Seeing if I can help German users get those last few characters on their keyboard working.
* Investigate and Improve Radar fps
* Investigate and Improve "All Red area" fps
Sounds good. :)
I will test the latest update, when I'm at home.
I also would request a little bit more colour for the text into the "sell/buy" screen for a better finding of Artifacts that you want to sell. All Ancient Artifact lines could be red, all Industrial blue and all Futuristic green. There also should be a free line between selling Artifacts and buying Stuff for a better overview. So it is more unlikeley to sell the wrong artifact. (Prices could be always golden)
I'm sure, the final Version will have a far better Screen for selling, buying Stuff. ^_^ To sped up things there could be also Buttons like "Sell everything" or "Sell all race - matching Items" and so on

EDIT: I had a short test with hte GalacticArtifact0253.exe but I couldn't see any difference. Special letters still doesn't work in this release. I also can't spot any "yellow debug messages" in the message pane ^_^
 
Last edited by a moderator:
Well, can't play much today (Monopoly at a friends house)

Just one quick thing, are there any specific bugs I can look for and try to duplicate to help you out? I will probably have more time later today.
 
For the daring:

http://games.randomlynx.net/GalacticArtifa...ct0269-TEST.rar

This is the test of the new threaded network code. It's a toxic mix of Threads and Networking, but I don't think it's crashing anymore.

The real check here is if you get dropped from the server during play (A lost server connection message).

I think I've hammered this all out, but haven't tried playing for 60 minutes+ to see if it's all gone now.

I gotta take a bit of a break now... Threads+Networking can make your eyes bleed. The basic stuff is simple enough, but the finer details can make of making it actually *work* without crashing or disconnecting is the frustrating bit. I'm sure it's fine once you get used to it.. I loved Java threads and networking and they didn't give me quite as much pain as C++. My inexperience with the language is at least half my pain.

Just a warning that the server will crash with a DOS attack, so don't try to join and quit 20 times in 5 seconds, it'll clobber the server for sure.

Later I'll get back some of the fun stuff of graphics and gameplay.

EDIT: Damn... The server is... well, not hanging, but rather not sending any messages to the client after a while... Gimme some time to work on this. Beta server will be going up and down for a while.

EDIT2: Sweet.. I think I fixed it. You can only have about 380 threads max unless you detach the thread with pthread_detatch.. otherwise creating a thread gives a mysterious "Error 12". 855 threads and still counting...
 
It said "you found the "Babababa Bug, try to reproduce what you just did."

All I did was press "*" before it connected to the server, then pressed "6" a bunch of times quickly. I just did it like 5 times in a row now, it only works on the Network Game.

I wonder if that helped at all.

Edit: Alternatively, you can just press "*" and wait for it to zoom all the way in, then press "6" once. It might have something to do with the server being down right now.

Edit 2: It only works after you go into an offline game at least once.

Edit 3: Apparently you can only get Babababa Bug when the server is down, or maybe your connection is really slow, or bad ping, maybe. I guess if someone on your network was bit-torrenting.
 
Hmm, that's odd. I won, but it didn't count down, instead the chat said:
QUOTE
Salak has won.
Connecting to the server...


It was around 3:05am PST.

Edit:

I was just ruminating about the math, thinking that there are around 4 million (4,782,969) sectors. What kind of fractions (artifact clues) would we use to cut that down... To narrow down the grid, we need some pretty large iterations for some of the artifacts.

52 of I-$ for 1.52 squares (3/4 ^ 52 = 1/3139166)
11 of I-$$ for 1.14 squares (1/4 ^ 11 = 1/4194304)
7 or I-$$$ for 2.28 squares (1/8 ^ 7 = 1/2097152)

324 of F-$ for 0.69 of a square ( ([([(80/81)*8]*8/9)*8]*1/9)^4 = 1/6838784) (1 in 9 of being 9x as useful, also a 1 in 81 of being 81x as useful)
45 of F-$$ for 0.72 of a square ( ([(8/9)*8]*1/9)^5 = 1/6566189) (1 in 9 of being 9x as useful)
7 of F-$$$ for 1 square (1/9 ^ 7 = 1/4782969) (same)

A-$ ?? A-$$ ?? A-$$$ ??

But since the probability of getting some of these is different, maybe the chance of finding each type of artifact could be worked into it somehow. I mean, finding 7 different F-$$$s or I-$$$s is much easier then getting over 300 F-$, or 52 of I-$. Maybe the futurist artifacts could be changed to include "half-sectors" or "third-sectors" so they can be more useful.
 
Wolfsclaw said:
Just a quick note that the new version did require me to have the pthreadGC2.dll file, which it didnt ask for before. Otherwise it wouldnt let me start the application. For anyone having the same problem just copy this file into the game directory:
http://postdownload.filefront.com/7674775/...551e6819d810805

and everythings working fine again.



Fixed in the very latest version. Apologies for that.. I did check for this but my win testing machine didn't give me the error even outside my testing environment for some reason.

... also...

TheMonkey, can you do me a favour?

I can't seem to reproduce this red area slowdown, even on my slow machine.

Can you first download the new version, and then try the following for me:

a) Cheat, and find out where the artifact is.
B) give me specific instructions on how to reproduce the red area bug, such as:

Artifact is in Sector 9
Get Futurist Artifact
Go to Sector 8
Use Futurist Artifact.
Go to Sector 855-5550
Red area gives x FPS.

It would be ideal if you could reproduce the slowdowns using only Futurist artifacts, as that's easiest to replicate. That might not be possible though....

It's possible there's some sort of red area layering affect, and you need a number of artifacts to get it. I'd appreciate if you could fine tune this and figure out if it gets worse with more artifacts. If it's more than one artifact information, is it a bunch of Ancient, Industrial, or Futurist Artifacts that do it?

I'm still going to research on my end, see if a bunch of info is required, but you've got more experience at this than I do at the moment.
 
Last edited by a moderator:
zear_ said:
Any chance for a linux build?
I would like to play too ;)
I have to sort out these GPL issues before I release another static binary. You willing to risk a dynamic one and have to hunt around or compile your own libs?

It almost certainly wont work on 64 bit linux either... not doing a good job of late of making Linux users happy... :|
 
Last edited by a moderator:
Trevor Bradley said:
You willing to risk a dynamic one and have to hunt around or compile your own libs?
Well, yes :D
I use Gentoo anyway.

Of course I'm not forcing you to compile a linux version if that's a problem.
I could just try to run it via Wine or something.
 
Last edited by a moderator:
zear_ said:
Trevor Bradley said:
You willing to risk a dynamic one and have to hunt around or compile your own libs?
Well, yes :D
I use Gentoo anyway.

Of course I'm not forcing you to compile a linux version if that's a problem.
I could just try to run it via Wine or something.


Next interim version I put out will have a dynamically compiled Linux binary then. Be prepared for SDL_gfx headaches though. :(

I got some very nice new graphics from Pat Ferguson this morning. I hope everyone likes them, they look pretty cool.
 
Last edited by a moderator:
Trevor Bradley said:
%(#*!

OK kids, do NOT do this in your for loops:

CODE
if (alien_match) {
for (int i=0;i<(int)visible_alien_stars.size();i++) {
for (int i=0;i<(int)visible_alien_stars.size();i++) {
I'm seeing some serious radar speed improvements now... :)

EDIT: That mistake was too stupid not to release a fix right away:

http://games.randomlynx.net/GalacticArtifa...ct0273-TEST.rar


No FPS Drops anymore with Radar in the Center of the Galaxy, very nice. ^^ Now, the only slowdown factor onto my Athlon XP (1,1 GHz @ 100MHz FSB just to complete my system Specs ;) ) is the Zoom.
Oh, I can't quit this 0273 build anymore. Nothing is working, Window stays open and I don't reach the menu of the Game, Music is still playing, Taskmanager says, programm still running. I have to use the Taskmanager to kick the Game from my Desktop. Am I the only one with this bug?

On-the-Fly Suggestion, could the Ship containing sector be centered, if there is one level zoomed out (Zoom Level 6) and using the Level 10 Radar? It is much more usable if you are always in the Center Sector when scanning the surrounding sectors. :)
 
Last edited by a moderator:
Back
Top