Jump to content

Something small to do for me?


Recommended Posts

Hi,

I'm a competent C++ Developer (at least I think so) and I'm working with wxWidgets and boost (<-heavily). I took also a look at SDL.

I've NO expirience with Java(Script) and I won't have, too.

I've not much time, but I love your game and would like to contribute. So it would be great, if you have a small task to do for me.

Link to comment
Share on other sites

Greetings and thanks for your interest! Help is very welcome ;)

We've started looking through the list of tickets and adding a "simple" keyword to indicate the task is limited in scope and doesn't require knowledge of a large portion of the codebase.

You can search for such tickets with the following query URL:

http://trac.wildfiregames.com/query?keywords=%7Esimple

Two of those are related to OpenGL and extension handling; another is basically a quick test of the game on a multiple-monitor system. If none of those strikes your fancy, please feel free to look through the list of tickets or post here and we'll find some more :P

Edited by janwas
Link to comment
Share on other sites

Well, i've no multiple monitor system and I've never worked with OpenGL. I know that those are not the best conditions to get into such a game project, but I was always searching for an open source AOE clone and now I want to contribute.

#113 is interesting, how many OpenGL skills will I need for that?

Link to comment
Share on other sites

OK, I've made a second pass through the tickets and marked a few more - please have another look at the above query URL. In particular, 307 and 311 would be helpful and straightforward (duplicate the error, see what pointer is NULL and why, fix ;) ), and #100 might be interesting if you have a thing for sound/music/OGG vorbis.

(Will be away for the weekend; have a good one + see you after)

Link to comment
Share on other sites

Well, I cannot start the game: the self-compiled pyrogenesis_dbg executable terminates after clicking the "Start!" button [single player menu]. Cause: Unhandled exception "PSERROR_GUI_InvalidSetting" in GUIutil.cpp: PS_RESULT GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Setting, T* &Value)

Link to comment
Share on other sites

Again just an error report, no fix: unhandled exeption 0x0c7f1d5a in pyrogenesis_dbg.exe: 0xC0000094: Integer division by zero. At: wrap_oal.dll [no symbols found]. Occurs right after the map has been loaded.

I get that too, but janwas didn't...

can you tell us which sound card are you using? it seems to be hardware related...

aside from that, I'm using the -quickstart fix for now

Edited by Sluzky
Link to comment
Share on other sites

hm, I'm guessing here, but this bug appears to bite when an OpenAL source is reused (the second music track that's played when a map has loaded) and its properties somehow aren't reset correctly by AL and it doesn't handle the resulting divide-by-zero.

I was foolhardy enough to rely on the documented defaults instead of always setting all properties - it would be better to always set every single property in vsrc_latch (even though that costs a bit of performance).

Would you be interested in tackling this? That would be helpful, especially because I can't duplicate the problem (it apparently doesn't come up on X-fi, where the OpenAL implementation is a native driver instead of a software layer on top of DX)

Link to comment
Share on other sites

  • 2 weeks later...

Sorry, not enough time the past weeks...

I tracked issue #307 down to CTextureEntry::CTextureEntry(CTerrainPropertiesPtr props, const CStr& path).

If CTerrainPropertiesPtr is NULL, OAD will crash at CTerrain::IsPassable in Terrain.cpp:


bool CTerrain::IsPassable(const CVector2D &loc/*tile space*/, HEntity entity) const
{
CMiniPatch *pTile = GetTile(loc.x, loc.y);
if(!pTile->Tex1)
{
return false; // Invalid terrain type in the scenario file
}
CTextureEntry *pTexEntry = g_TexMan.FindTexture(pTile->Tex1);

CTerrainPropertiesPtr pProperties = pTexEntry->GetProperties();

// ugly workaround from here
bool rv;

if(pProperties)
rv = pProperties->IsPassable(entity); //<- it would crash here
else{
rv = false;
LOGMESSAGE("pProperties was NULL");
}

return rv;
}

With this workaround the game is at least playable. I wrote


if (m_pProperties)
m_Groups = m_pProperties->GetGroups();

into the ctor of CTextureEntry and the Pyrogenesis Log looked like this:

CRenderer::Open: depth bits 24

CRenderer::Open: stencil bits 8

CRenderer::Open: alpha bits 8

I18n: No translation found for string 'Want to move some Dudes around or test something? Click here to start a new game on the default map.'

I18n: No translation found for string 'Tired of playing with yourself? Fight against one or more human players in a multiplayer game.'

I18n: No translation found for string 'Click here to change the civilization you would like to play.'

I18n: No translation found for string 'Click this button to start a new game with the current settings.'

Creating shadow texture (size 1024x1024) (format = DEPTH_COMPONENT) (using EXT_framebuffer_object)

WARNING: setting cell_id was not found on object ldProgressBar

I18n: No translation found for string 'CGameView init'

WARNING: setting cell_id was not found on object ldProgressBar

I18n: No translation found for string 'LoadTerrainTextures'

WARNING: setting cell_id was not found on object ldProgressBar

CTextureManager::RecurseDirectory(art/textures/terrain/types/): no terrains.xml (or errors while loading) - using parent properties

CTextureManager::RecurseDirectory(art/textures/terrain/types/grass/): no terrains.xml (or errors while loading) - using parent properties

WARNING: m_pProperties is NULL

Hope this is still useful for you!

Link to comment
Share on other sites

Cool :)

I tracked #311 now. I'm afraid I couldn't patch it because of lots and lots of side-effects.

The crash occurs at the following lines of code when GetPatch(x/PATCH_SIZE,z/PATCH_SIZE) returns 0:


float CTerrain::FlattenArea(float x0, float x1, float z0, float z1)
{
ssize_t tx0=clamp(ssize_t((x0/CELL_SIZE)), ssize_t(0), m_MapSize);
ssize_t tx1=clamp(ssize_t((x1/CELL_SIZE)+1.0f), ssize_t(0), m_MapSize);
ssize_t tz0=clamp(ssize_t((z0/CELL_SIZE)), ssize_t(0), m_MapSize);
ssize_t tz1=clamp(ssize_t((z1/CELL_SIZE)+1.0f), ssize_t(0), m_MapSize);

size_t count=0;
size_t y=0;
for (ssize_t x=tx0;x<=tx1;x++) {
for (ssize_t z=tz0;z<=tz1;z++) {
y+=m_Heightmap[z*m_MapSize + x];
count++;
}
}
y/=count;

for (ssize_t x=tx0;x<=tx1;x++) {
for (ssize_t z=tz0;z<=tz1;z++) {
m_Heightmap[z*m_MapSize + x]=(u16)y;
CPatch* patch=GetPatch(x/PATCH_SIZE,z/PATCH_SIZE);
patch->SetDirty(RENDERDATA_UPDATE_VERTICES); // crash! (#311)
}
}

return y*HEIGHT_SCALE;
}

GetPatch(x/PATCH_SIZE,z/PATCH_SIZE) may return 0:


CPatch* CTerrain::GetPatch(ssize_t i, ssize_t j) const
{
// range check: >= 0 and < m_MapSizePatches
if( (size_t)i >= (size_t)m_MapSizePatches || (size_t)j >= (size_t) m_MapSizePatches )
return 0;

return &m_Patches[(j*m_MapSizePatches)+i];
}

Have a look at Terrain.cpp and you will notice that the result of GetPatch is always used unguarded, being a permanent source of trouble. I suggest using (at least) asserts there. Also I would use boost::smart_ptrs as often as possible - just my opinion.

A simple if(patch) causes some (to me) strange effects, including a crash at shutdown. Just try.

No more time today and probably the next few days to fix this. Hope I could help you, though.

Link to comment
Share on other sites

  • 2 weeks later...

Update: Now I'm back again with my new Linux notebook, installation of 0AD went quite well (one package was missing; I think it was pkg-config - maybe you want to add it to the documentation).

I took a look at CTerrain again and think I killed the bug. This is the fixed version, watch out for comments:


///////////////////////////////////////////////////////////////////////////////
// FlattenArea: flatten out an area of terrain (specified in world space
// coords); return the average height of the flattened area
float CTerrain::FlattenArea(float x0, float x1, float z0, float z1)
{
ssize_t tx0=clamp(ssize_t((x0/CELL_SIZE)), ssize_t(0), m_MapSize-1); //changed from
ssize_t tx1=clamp(ssize_t((x1/CELL_SIZE)+1.0f), ssize_t(0), m_MapSize-1); //m_MapSize to
ssize_t tz0=clamp(ssize_t((z0/CELL_SIZE)), ssize_t(0), m_MapSize-1); //m_MapSize-1
ssize_t tz1=clamp(ssize_t((z1/CELL_SIZE)+1.0f), ssize_t(0), m_MapSize-1); //the good old nasty indexing issue ;)

size_t count=0;
size_t y=0;
for (ssize_t x=tx0;x<=tx1;x++) {
for (ssize_t z=tz0;z<=tz1;z++) {
y+=m_Heightmap[z*m_MapSize + x];
count++;
}
}
y/=count;

for (ssize_t x=tx0;x<=tx1;x++) {
for (ssize_t z=tz0;z<=tz1;z++) {
m_Heightmap[z*m_MapSize + x]=(u16)y;
CPatch* patch=GetPatch(x/PATCH_SIZE,z/PATCH_SIZE);
if(patch == 0) std::cerr << "CPATCH is 0" << std::endl; // just my debugging output
else patch->SetDirty(RENDERDATA_UPDATE_VERTICES); // but since GetPatch may return 0 (and it does: #311) we'll check for that now. At this point I don't expect any performance issues.
}
}

return y*HEIGHT_SCALE;
}

Keep me up to date if there's something small to do for me.

Link to comment
Share on other sites

  • 3 weeks later...

I'm sorry about the lack of a response - this thread got lost in my flood of open tabs. Thanks again for tracking down the bug, and also asking about its status via IM! :)

The issue is now fixed, I've checked all call sites and also improved the indexing logic in the rest of terrain.cpp.

Link to comment
Share on other sites

  • 2 months later...

Ok.. im not involved in the programing here. Just sitting on the sideline eager to test this. But i updated with tortoise today. Cleaned solution amd rebuilt it. Started the debuging. Choose single player. Load a game and then i get:

Unhandled exception at 0x0a991d5a in pyrogenesis_dbg.exe: 0xC0000094: Integer division by zero.

I have not been able to test the game yet.

But i think this is a wonderful project and im really looking forward to se it for my self.

Link to comment
Share on other sites

Greetings!

hm, I've just successfully tested Win32 VC2005 debug and release builds of r7264, loading the default map with command line argument -onlyPublicFiles. Are you doing anything different?

Are you able to see where exactly it is crashing in the debugger? (If you're getting our "Much to our regret.." dialog box without a meaningful call stack, you can comment out the __try and __except lines in source\lib\sysdep\os\win\wseh.cpp to let the IDE handle the exception - it has somewhat studlier handling of debug information)

Link to comment
Share on other sites

It looks like this is a sound-related issue (possibly due to a bug in OpenAL), see http://trac.wildfiregames.com/ticket/449

Do you by any chance have an onboard sound chip? (See %appdata%/0ad/logs/system_info.txt)

It probably won't help in this case, but in future if you need to run 0ad with command line arguments, one way to do so is to open up a shell (cmd.exe), change directory to the 0ad/binaries/system folder, then type pyrogenesis.exe -quickstart -otherArgumentsAsNeeded and hit enter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...