missing files on master

For code related discussions and questions

missing files on master

Postby dskiller1 » 27 Oct 2016, 08:29

is it me or is gamelib_msvc2015.vcxproj not updated for files that was recently removed.

gamelib wont compile because it missing .cpp files.
gamelib_msvc2015.vcxproj shows

Include="hashtable.cpp"
Include="anim.cpp"

not found in gamelib.

sorry dont know if should file ticket or just ask here.


I know animations is being worked on. but not everything to being updated to reflect it...
dskiller1
Greenhorn
 
Posts: 10
Joined: 18 Sep 2016, 02:33

Re: missing files on master

Postby Per » 27 Oct 2016, 09:18

Sorry, I can't test that build system. I've pushed an attempted fix (just removing those files from the build system, since they are not needed anymore).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

Re: missing files on master

Postby dskiller1 » 27 Oct 2016, 21:12

there was some other problems but I managed to fix them.
dskiller1
Greenhorn
 
Posts: 10
Joined: 18 Sep 2016, 02:33

Re: missing files on master

Postby flybyray » 30 Oct 2016, 13:50

dskiller1 wrote:there was some other problems but I managed to fix them.


Would be nice to here from your fixes. I startet yesterday with the visualstudio build and it worked all great ( https://github.com/Warzone2100/warzone2 ... /README.md ; thank you https://github.com/vlj )

I wanted to know why warzone crashes so often.
I would like to change the contribuition policies. I do not know the sh*t TRAC System. I do not have an account there and cannot get into this system.
Why not doing PR on github as default? I have 1 PR and possible another location some animation calculation which needs fixes too.
But it is a nightmare to get this game running again. I would like to know what was the intention to relase 3.2.x as it is now. :augh:
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby Per » 30 Oct 2016, 16:20

What GPU do you have? Is it another Intel integrated chipset?

Trace is a bit dated, I agree. If you want, you can use github pull requests.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

Re: missing files on master

Postby flybyray » 30 Oct 2016, 21:04

it is a system with nvidia optimus. i can use intel and nvidia graphics but have to choose it before start of execution.
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby Per » 30 Oct 2016, 21:25

What are the crashes you get when you run with Nvidia?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

Re: missing files on master

Postby flybyray » 30 Oct 2016, 22:57

Release?
viewtopic.php?f=1&t=12528#p134757

Master I dont know QScriptValue .... debug_sync ... it depends on ...
i dont know how to start to get this good game running again
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby flybyray » 30 Oct 2016, 23:21

i worked on master.

1: Sometimes the "elapsed" Value was negative resulting in crash. I added GAME_TICKS_PER_UPDATE to make it positiv.
Code: Select all
diff --git a/src/display3d.cpp b/src/display3d.cpp
index 45b5115..451e946 100644
--- a/src/display3d.cpp
+++ b/src/display3d.cpp
@@ -337,7 +337,7 @@ void drawShape(BASE_OBJECT *psObj, iIMDShape *strImd, int colour, PIELIGHT build
        }
        if (strImd->objanimframes)
        {
-               const int elapsed = graphicsTime - psObj->timeAnimationStarted;
+               const int elapsed = GAME_TICKS_PER_UPDATE + graphicsTime - psObj->timeAnimationStarted;
                const int frame = (elapsed / strImd->objanimtime) % strImd->objanimframes;
                const ANIMFRAME &state = strImd->objanimdata[frame];
                if (state.scale.x == -1.0f) // disabled frame, for implementing key frame animation


2: it crashed here sometimes because the list was size==0
Code: Select all
diff --git a/src/hci.cpp b/src/hci.cpp
index e96f121..4acf38e 100644
--- a/src/hci.cpp
+++ b/src/hci.cpp
@@ -1786,7 +1786,8 @@ static void intAddObjectStats(BASE_OBJECT *psObj, UDWORD id)
        {
                fillTemplateList(apsTemplateList, (STRUCTURE *)psObj);
                numStatsListEntries = apsTemplateList.size();
-               ppsStatsList = (BASE_STATS **)&apsTemplateList[0];  // FIXME Ugly cast, and is undefined behaviour (strict-aliasing violation) in C/C++.
+               if(apsTemplateList.capacity()>0)
+                       ppsStatsList = (BASE_STATS **)&apsTemplateList[0];  // FIXME Ugly cast, and is undefined behaviour (strict-aliasing violation) in C/C++.
        }

        /*have to calculate the list each time the Topic button is pressed


3: crashes in syncDebug. string conversion bugs.
Code: Select all
diff --git a/src/qtscriptfuncs.cpp b/src/qtscriptfuncs.cpp
index ba34dff..e4825c8 100644
--- a/src/qtscriptfuncs.cpp
+++ b/src/qtscriptfuncs.cpp
@@ -4296,11 +4296,16 @@ QScriptValue js_stats(QScriptContext *context, QScriptEngine *engine)
        int type = callee.property("type").toInt32();
        int player = callee.property("player").toInt32();
        unsigned index = callee.property("index").toUInt32();
-       QString name = callee.property("name").toString();
+       QString name = "unknown";
+       if (callee.property("name").isValid()) {
+               name = callee.property("name").toString();
+       }
        if (context->argumentCount() == 1) // setter
        {
                int value = context->argument(0).toInt32();
-               syncDebug("stats[p%d,t%d,%s,i%d] = %d", player, type, name.toStdString().c_str(), index, value);
+               std::string nameToStdString = name.toUtf8().constData();
+               const char *nameToStdStringC_str = nameToStdString.c_str();
+               syncDebug("stats[p%d,t%d,%s,i%d] = %d", player, type, nameToStdStringC_str, index, value);
                if (type == COMP_BODY)
                {
                        SCRIPT_ASSERT(context, index < numBodyStats, "Bad index");
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby flybyray » 30 Oct 2016, 23:23

now it is working at least for some more seconds perhaps minutes hours in singleplayer.
ok played a fast single player and multiplayer with bots worked well.
i got one crash in the lobby. i think some method drawText is buggy or needs some more checks.
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby Vincent » 31 Oct 2016, 03:35

in debug mode or in release mode ?
In debug mode I have a crash too, it seems to be related to va_arg in the custom printf function used by the script engine.
Vincent
Trained
Trained
 
Posts: 77
Joined: 06 Aug 2016, 17:24

Re: missing files on master

Postby flybyray » 31 Oct 2016, 08:35

i dont know. in windows if i start warzone with "--debug all" it does not start at all. i put "debugmode=1" in the config file but that printed not so much.
therefore i changed debug.h
Code: Select all
diff --git a/lib/framework/debug.h b/lib/framework/debug.h
index 1da3aa4..19952c8 100644
--- a/lib/framework/debug.h
+++ b/lib/framework/debug.h
@@ -258,7 +258,7 @@ bool debug_enable_switch(const char *str);
  *
  * Only outputs if debugging of part was formerly enabled with debug_enable_switch.
  */
-#define debug(part, ...) do { if (enabled_debug[part]) _debug(__LINE__, part, __FUNCTION__, __VA_ARGS__); } while(0)
+#define debug(part, ...) do { if (true) _debug(__LINE__, part, __FUNCTION__, __VA_ARGS__); } while(0)
 void _debug(int line, code_part part, const char *function, const char *str, ...) WZ_DECL_FORMAT(printf, 4, 5);

 #define debugBacktrace(part, ...) do { if (enabled_debug[part]) { _debug(__LINE__, part, __FUNCTION__, __VA_ARGS__); _debugBacktrace(part); }} while(0)
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby flybyray » 31 Oct 2016, 08:40

Vincent wrote:in debug mode or in release mode ?
In debug mode I have a crash too, it seems to be related to va_arg in the custom printf function used by the script engine.


The problem in debug is, that most variables/pointers (especially uninitalized) are set to a value (0xcccc...). but if consumers assume they are initialized, it will result in crashes.
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Re: missing files on master

Postby dskiller1 » 31 Oct 2016, 13:46

flybyray wrote:
dskiller1 wrote:there was some other problems but I managed to fix them.


Would be nice to here from your fixes. I startet yesterday with the visualstudio build and it worked all great ( https://github.com/Warzone2100/warzone2 ... /README.md ; thank you https://github.com/vlj )

I wanted to know why warzone crashes so often.
I would like to change the contribuition policies. I do not know the sh*t TRAC System. I do not have an account there and cannot get into this system.
Why not doing PR on github as default? I have 1 PR and possible another location some animation calculation which needs fixes too.
But it is a nightmare to get this game running again. I would like to know what was the intention to relase 3.2.x as it is now. :augh:


edit:

I couldnt get it to build without removing some include files that was removed.

and it was trying to look for audp_lexer.hpp when there is no file with hpp

which seems to be fixed now.
dskiller1
Greenhorn
 
Posts: 10
Joined: 18 Sep 2016, 02:33

Re: missing files on master

Postby flybyray » 01 Nov 2016, 00:53

I really followed only the readme.
That means exactly i executed batch files which set the environment exactly as told in the README.md.
startup files to set environment

I use those batch files like this screenshare

I changed only those files: compare master with my tests
flybyray
Rookie
Rookie
 
Posts: 19
Joined: 01 Oct 2007, 01:42

Next

Return to Coding