Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 43 44 [45] 46 47 ... 55

Author Topic: The DF 0.31.04 Work-In-Progress Thread  (Read 212389 times)

voneiden

  • Bay Watcher
  • hngh
    • View Profile
Logged

Veroule

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #661 on: May 27, 2010, 05:23:31 pm »

Love those globals...at least I think it already is a global and not defined as a member of the game view.
I'd rather just ask Toady for the flag. :P
A cleaner OO way of doing it is to move the increment of the FPS counter into interfacest::loop behind an if.
    if (currentscreen->logic()) update_fps();
Toady would have to add the returns all over the place.  It is more work but better form.

Also since I am looking at it there are a few changes that should be made in interfacest::loop anyhow.
at line 858 of interface.cpp
---    if (currentscreen->child==NULL) currentscreen->logic();
+++ currentscreen-->logic();
The child member will always be null here and removing the if can shave a few more clock cycles.

at line 872
---        if (era.size() == 0) {
---          if(enabler.mouse_lbut || enabler.mouse_rbut) currentscreen->feed(era);
---          break;
---        }
This seems to be left over from when the key_conflict bad stuff back got back in.  Those lines should be moved down to 932.
at line 928
---       currentscreen->feed(era);
at line 932
+++        if (era.size() == 0) {
+++          if(enabler.mouse_lbut || enabler.mouse_rbut) currentscreen->feed(era);
+++        } else currentscreen->feed(era);

I am going to look a little more for when the key_conflict got put back.  It is just a bad idea.
Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.

anacrucis

  • Bay Watcher
    • View Profile
Re: fmodex.dll?
« Reply #662 on: May 27, 2010, 05:38:03 pm »

Hi, apologies if this has already come up in this thread (a quick search indicated it hasn't) - has anyone had an "fmodex.dll not found" error? I can see the file sitting right there in the df_31_04_win directory. Running XP SP3.

(similarly?) on my desktop (running Vista, SP?) I got an error that mouse.png could not be found, when it's right there in the directory it purported not to be found in.

Must say I've learned a lot about editing init.txt, but the dll issue is sort of a show stopper for 0.31.4 on the lappy. This means my dwarfs may have to resort to playing in the melting rain for their daily dose of Fun.
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #663 on: May 27, 2010, 07:52:14 pm »

I fixed the annoying bug where (most notably) having lots of rocks causes the stock screen to skip over the rock entry. Not a very nice fix, but it works; I'll figure out something nicer later, maybe.

A 31.05 may be coming up soon.

Key-repeat acceleration is in, and on by default. It's configurable, but I don't think anyone will be bothered by the current implementation.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Veroule

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #664 on: May 27, 2010, 08:09:58 pm »

Baughn, got another keyboard bug.  In order to replicate it you need to cause a nice delay during the game logic loop, hooking a lever to about 15 bridges and setting a dwarf to repeat pull should do it.  Then press and release U then press and release M.  If you replicated the bug the Military screen will be displaying.  Pressing ESC at this point will cause the Units List screen to be displayed, I can't quite figure why it goes to the Units here.  The correct result would be the display of the Manager screen.

In any case it looks like the problem is caused in one of the many spots where you create an iterator and then change the contents of the container.  Per http://www.cppreference.com/wiki/stl/iterators at the bottom of the page...Invalidating Iterators; it is a bad idea.  I couldn't find anything indicating what protections the set template provides for that type of change, maybe it protects it entirely.
Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #665 on: May 27, 2010, 08:16:35 pm »

Baughn, got another keyboard bug.  In order to replicate it you need to cause a nice delay during the game logic loop, hooking a lever to about 15 bridges and setting a dwarf to repeat pull should do it.  Then press and release U then press and release M.  If you replicated the bug the Military screen will be displaying.  Pressing ESC at this point will cause the Units List screen to be displayed, I can't quite figure why it goes to the Units here.  The correct result would be the display of the Manager screen.

Sounds like this bug (one of the notes mentions going to the wrong menu after hitting Esc).  I don't think the lever-pulling is necessary to reproduce it.
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #666 on: May 27, 2010, 08:24:32 pm »

For all the tree-based structures (including set, map and list (a list is a very unbalanced tree, okay?)), altering the structure does not invalidate any iterators except those pointing to a now-erased node.

The bug is real, though, I just don't think that's why. Weird bug.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Veroule

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #667 on: May 27, 2010, 08:49:53 pm »

I will look into that U,M one more and see if I can think of where in the code it lies.

Since a number of the bugs people reported seemed to stop happening with completely unrelated init.txt changes I was keeping an eye out for odd memory corruptions.  I just read through the initial commit with all of Toady's changes and spotted this one.  In win32_compat.cpp he added an itoa function.
at line 74
+  *out = 0;
   std::reverse(result, out);
-  *out = 0;

Also the "abs(quot%base)" above that should just be "quot%base"  with the abs being preformed once when quot is initially assigned.
Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.

Veroule

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #668 on: May 27, 2010, 09:59:22 pm »

Speaking of that itoa the use of reverse can be eliminated by calculating the length.  For small numbers the calculation would probably be nearly the same clock cycles, but larger values would definitely be faster.  You might try it for some speed tests, I am going to guess that saving would be where it is called the most.
Spoiler (click to show/hide)
« Last Edit: May 27, 2010, 10:00:59 pm by Veroule »
Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.

Mr. Accident

  • Bay Watcher
  • No playing in the crater.
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #669 on: May 28, 2010, 02:22:15 am »

You kidding me?  I've put myself through 1 - 2 fps for regular DF games, hours spent watching my dwarfs going to the stockpile and then drinking for hours. 

Some people don't realize how good they have it...

1 to 2 FPS? Luxury! Why, we used to have to share a single frame every minute, all twenty-six of us, with no backlight, and 'alf the screen was missing, and we were all huddled in one corner for fear of falling...

A single frame? You were lucky to have a frame! We had to live in the hole of a punch card dropped under the central housing of a UNIVAC II in a decommissioned nuclear silo, and every-morning we'd have to get up at 4;00 AM and die of radiation that was leaking from a nearby cracked warhead. But we were happy then....

*sticks nose in air*
A whole punch card? YOU WERE LUCKY TO HAVE A PUNCH CARD! Back in my day, we had to work for a unforgiving blood god (His name was Armok, but we called him "The Player", and not for his notorious pimping of the cats) who usually sacrificed us for a HOLE. But we were ecstatic back then...

Well, when I call it a punch card, it was more of broken-off sliver of the Antikythera mechanism, floating in a puddle of radioactive septic goo that had a tendency to mutate animals into obnoxious teenaged vigilante's.... but it was a punch card to us!

You were lucky to have your puddle of radioactive septic goo! There were a hundred and fifty of us living on a single hard disk platter in a broken-down IBM RAMAC that rendered about three frames during the entire Clinton administration. Every morning at six we'd get up, defragment the hard drive with our tongues, and head down to the mill where we'd have our arms and legs ripped off by elephants for a chance at seeing a single 'E'!
Logged

Rex_Nex

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #670 on: May 28, 2010, 03:05:21 am »

You kidding me?  I've put myself through 1 - 2 fps for regular DF games, hours spent watching my dwarfs going to the stockpile and then drinking for hours. 

Some people don't realize how good they have it...

1 to 2 FPS? Luxury! Why, we used to have to share a single frame every minute, all twenty-six of us, with no backlight, and 'alf the screen was missing, and we were all huddled in one corner for fear of falling...

A single frame? You were lucky to have a frame! We had to live in the hole of a punch card dropped under the central housing of a UNIVAC II in a decommissioned nuclear silo, and every-morning we'd have to get up at 4;00 AM and die of radiation that was leaking from a nearby cracked warhead. But we were happy then....

*sticks nose in air*
A whole punch card? YOU WERE LUCKY TO HAVE A PUNCH CARD! Back in my day, we had to work for a unforgiving blood god (His name was Armok, but we called him "The Player", and not for his notorious pimping of the cats) who usually sacrificed us for a HOLE. But we were ecstatic back then...

Well, when I call it a punch card, it was more of broken-off sliver of the Antikythera mechanism, floating in a puddle of radioactive septic goo that had a tendency to mutate animals into obnoxious teenaged vigilante's.... but it was a punch card to us!

You were lucky to have your puddle of radioactive septic goo! There were a hundred and fifty of us living on a single hard disk platter in a broken-down IBM RAMAC that rendered about three frames during the entire Clinton administration. Every morning at six we'd get up, defragment the hard drive with our tongues, and head down to the mill where we'd have our arms and legs ripped off by elephants for a chance at seeing a single 'E'!

WHAT? A WHOLE DISK PLATTER? BLASPHEMY!
When I was your age, over 9000 of us lived in a single particle of matter! Every day we had to be on the lookout for flying electron particles, while the very neurons that we stood on kept giving way, killings hundreds of us every day!
Logged

Lord Darkstar

  • Bay Watcher
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #671 on: May 28, 2010, 03:34:58 am »

I've found a very neat bug. My apologies if this has already been reported:

If you dig a descending staircase/fortress area through a cavern without revealing the cavern (you didn't break into the cave), your weavers will walk down to the z-level where there is spider silk, go as far as they can towards it, then collect the silk. This bug keeps your weavers safe.

Next time I break into a cavern system, I'll have to try walling off the whole cave, and see if my weavers will be able to collect that spider web as well.

Thanks for the fun game!
Logged
learn to give consolations to frustrated people
What is this, a therapy session? We don't need to console someone because they're upset about a fucking video game. Grow a beard, son, and take off those elf ears!

Tarran

  • Bay Watcher
  • Kind of back, but for how long?!
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #672 on: May 28, 2010, 03:46:40 am »

You kidding me?  I've put myself through 1 - 2 fps for regular DF games, hours spent watching my dwarfs going to the stockpile and then drinking for hours. 

Some people don't realize how good they have it...

1 to 2 FPS? Luxury! Why, we used to have to share a single frame every minute, all twenty-six of us, with no backlight, and 'alf the screen was missing, and we were all huddled in one corner for fear of falling...

A single frame? You were lucky to have a frame! We had to live in the hole of a punch card dropped under the central housing of a UNIVAC II in a decommissioned nuclear silo, and every-morning we'd have to get up at 4;00 AM and die of radiation that was leaking from a nearby cracked warhead. But we were happy then....

*sticks nose in air*
A whole punch card? YOU WERE LUCKY TO HAVE A PUNCH CARD! Back in my day, we had to work for a unforgiving blood god (His name was Armok, but we called him "The Player", and not for his notorious pimping of the cats) who usually sacrificed us for a HOLE. But we were ecstatic back then...

Well, when I call it a punch card, it was more of broken-off sliver of the Antikythera mechanism, floating in a puddle of radioactive septic goo that had a tendency to mutate animals into obnoxious teenaged vigilante's.... but it was a punch card to us!

You were lucky to have your puddle of radioactive septic goo! There were a hundred and fifty of us living on a single hard disk platter in a broken-down IBM RAMAC that rendered about three frames during the entire Clinton administration. Every morning at six we'd get up, defragment the hard drive with our tongues, and head down to the mill where we'd have our arms and legs ripped off by elephants for a chance at seeing a single 'E'!

WHAT? A WHOLE DISK PLATTER? BLASPHEMY!
When I was your age, over 9000 of us lived in a single particle of matter! Every day we had to be on the lookout for flying electron particles, while the very neurons that we stood on kept giving way, killings hundreds of us every day!

Only hundreds?!

Son, in my day we didn't have 9,000 of us in one particle, no, not 9,000, not 10,000, not 1,000,000, not even 100,000,000. No, we had 100,000,000,000,000,000,000 of us in one particle!

Every day we would lose hundreds of thousands for each Picometre of movement anywhere on the earth! We stopped counting the deaths a mere second after we started!
Logged
Quote from: Phantom
Unknown to most but the insane and the mystics, Tarran is actually Earth itself, as Earth is sentient like that planet in Avatar. Originally Earth used names such as Terra on the internet, but to protect it's identity it changed letters, now becoming the Tarran you know today.
Quote from: Ze Spy
Tarran has the "Tarran Bug", a bug which causes the affected character to repeatedly hit teammates while dual-wielding instead of whatever the hell he is shooting at.

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #673 on: May 28, 2010, 05:15:50 am »

Speaking of that itoa the use of reverse can be eliminated by calculating the length.  For small numbers the calculation would probably be nearly the same clock cycles, but larger values would definitely be faster.  You might try it for some speed tests, I am going to guess that saving would be where it is called the most.
Nope, it's practically not called at all. I'm not going to bother trying to optimize unused code.. making it correct, okay, that's another matter.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: The DF 0.31.04 Work-In-Progress Thread
« Reply #674 on: May 28, 2010, 05:23:50 am »

Since a number of the bugs people reported seemed to stop happening with completely unrelated init.txt changes I was keeping an eye out for odd memory corruptions.  I just read through the initial commit with all of Toady's changes and spotted this one.  In win32_compat.cpp he added an itoa function.
at line 74
+  *out = 0;
   std::reverse(result, out);
-  *out = 0;
Actually, that's perfectly fine. std::reverse doesn't look for zeroes, so whether the terminator is added before or after the call doesn't matter.
Quote
Also the "abs(quot%base)" above that should just be "quot%base"  with the abs being preformed once when quot is initially assigned.
Point, but another micro-optimization on unused code; not really worth thinking about whether it'd still be correct.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?
Pages: 1 ... 43 44 [45] 46 47 ... 55