Jump to content

crazy_Baboon

Community Members
  • Posts

    97
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by crazy_Baboon

  1. Hi,

    I am trying to adapt 3D models from FlightGear and use them in 0ad.

    FlightGear models are stored in the .ac format, while 0ad uses collada .dae.

    In Blender 2.82, I have successfully imported an .ac model, but when i try to convert it to  collada (.dae), the model appears to loose its texture:

    The .ac file in Blender:

    1472382709_Screenshotfrom2020-03-2109-32-36.thumb.png.78898dd86e2df239dc9f0e58c87d6280.png

    The converted .dae file in 0ad:

    1320417309_Screenshotfrom2020-03-2109-32-18.thumb.png.fb8aed9ee57bed187dcb2621f5748460.png

     

    Does anyone know why the texture is not showing in the collada .dae file?

    How do I fix this?

     

    Thanks!

     

     

    • Like 1
  2. Hi,

    I was wondering... is there a mod in 0ad that features modern military warfare (heavy panzer, fighter jets, nukes... etc)?

    I remember there used to a great game called rise of nations, that would take you from pre-history to the 2000s.

  3. Hi folks!

     

    I have designed a new map: Afrika Australis (Southern Africa). It is based on NASA blue marble map series.

    The map includes several biomes, ranging from sandy deserts to mountain climate and tropical basin - the biomes are based on https://www.gifex.com/fullsize-en/2010-01-11-11674/Biomes_of_Africa.html.

    The natural resource distribution is based on https://www.aljazeera.com/indepth/interactive/2016/10/mapping-africa-natural-resources-161020075811145.html, with most stone occurring on the west and most metal occurring on the east of the continent.

    Given the size of the continental shelf, expect brutal continental battles.

    Here are some screenshots:

    792570503_Screenshotat2020-02-2018-35-43.thumb.png.4fd1c0c67913b1d9d238085b31f82081.png

    540037221_Screenshotat2020-02-2122-08-16.thumb.png.422da569f3ba0975129d874a949bf5b9.png

    608175395_Screenshotat2020-02-2122-09-12.thumb.png.3514c165c9acad3eb95b06a0dcdbc575.png

     

    Download the map - featured in the screenshots above - here: Afrika_Australis.xmlAfrika_Australis.pmp

    For a more updated version of the map, please check https://gitlab.com/CrazyBaboon/0ad_maps

    This map was designed to work with Alpha 24. Let me know what you think of the map! 

    Thanks!

     

    You can also have a look at my other 0ad maps, in my gitlab repo https://gitlab.com/CrazyBaboon/0ad_maps

    • Like 1
  4. 20 hours ago, Lion.Kanzen said:

    Will be necessary or kind add more biomes. Map around of world.

    This map only makes sense as it is really: tropical Indonesia and temperate china - 2 biomes in a single map.

    The idea of having something like "desert Indonesia" does not appeal to me.

    Of course, the license of the map allows you to add whatever biomes you like!

     

    However, I am interested to do more regions of the world (with different biomes).

     

    • Like 1
  5. This is a tropical naval map consisting of mainland Vietnam, Laos, Malaisia, Camboja together with Indonisia. All players start in large jungle islands with only wood as a primitive resource. To get metal and stone, the players need to go out in the sea and find these resources elsewhere. But beware of the animal beasts scattered all over these rich areas...

    South_East_Asia.thumb.png.f35e7158631c81ac7a19e5b6c20d4b6c.png

     

    Screenshot_from_2019-06-10_19-45-51.thumb.png.ced11b7ff7bbc4bb23e9099059b972ab.png

    Screenshot_from_2019-06-10_20-20-46.thumb.png.043c6fbc079d1cbf353836bd5308fec6.png

    If I remember well,. this is a giant map that can take up to 6 players. Despite the abundant vegetation, it runs smoothly on an old desktop from 2011.

    Also, If I remember, i adapted it from the Blue Marble NASA map series and its based on the ALPHA 24 version of 0ad (that is currently under development).

     

    Let me know what you think! :)

    • Like 6
  6. Hi,

    I am new to phabricator and arcanist.

    I have an updated local clone of 0ad git repository.


    I am trying to apply some new revision, for example D375. Now, if I try arc patch D375 and I get:

     INFO  Base commit is not in local repository; trying to fetch.
    Created and checked out branch arcpatch-D375.
    Checking patch binaries/data/mods/public/simulation/components/ProductionQueue.js...
    error: while searching for:
    
                   Engine.PostMessage(this.entity, MT_ProductionQueueChanged, { });
    
                   // If this is the first item in the queue, start the timer
                   if (!this.timer)
                   {
                           var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
                           this.timer = cmpTimer.SetTimeout(this.entity, IID_ProductionQueue, "ProgressTimeout", g_ProgressInterval, {});
                   }
           }
           else
           {
    
    error: patch failed: binaries/data/mods/public/simulation/components/ProductionQueue.js:383
    error: while searching for:
                                   // Unset flag that training is blocked
                                   cmpPlayer.UnBlockTraining();
                           }
    
                           if (item.technologyTemplate)
                           {
                                   // Mark the research as started.
                                   var cmpTechnologyManager = QueryOwnerInterface(this.entity, IID_TechnologyManager);
                                   cmpTechnologyManager.StartedResearch(item.technologyTemplate, true);
                           }
    
                           item.productionStarted = true;
                           if (item.unitTemplate)
                                   Engine.PostMessage(this.entity, MT_TrainingStarted, {"entity": this.entity});
                   }
    
                   // If we won't finish the batch now, just update its timer
                   if (item.timeRemaining > time)
                   {
                           item.timeRemaining -= time;
                           // send a message for the AIs.
                           Engine.PostMessage(this.entity, MT_ProductionQueueChanged, { });
                           break;
                   }
    
                   if (item.unitTemplate)
                   {
                           var numSpawned = this.SpawnUnits(item.unitTemplate, item.count, item.metadata);
    
    error: patch failed: binaries/data/mods/public/simulation/components/ProductionQueue.js:718
    error: while searching for:
                           {
                                   // All entities spawned, this batch finished
                                   cmpPlayer.UnReservePopulationSlots(item.population * numSpawned);
                                   time -= item.timeRemaining;
                                   this.queue.shift();
                                   // Unset flag that training is blocked
                                   cmpPlayer.UnBlockTraining();
    
    error: patch failed: binaries/data/mods/public/simulation/components/ProductionQueue.js:747
    error: while searching for:
                                           cmpSoundManager.PlaySoundGroup(template.soundComplete, this.entity);
                           }
    
                           time -= item.timeRemaining;
    
                           this.queue.shift();
                           Engine.PostMessage(this.entity, MT_ProductionQueueChanged, { });
                   }
           }
    
           // If the queue's empty, delete the timer, else repeat it
           if (this.queue.length == 0)
           {
                   this.timer = undefined;
    
                   // Unset flag that training is blocked
                   // (This might happen when the player unqueues all batches)
                   cmpPlayer.UnBlockTraining();
    
    error: patch failed: binaries/data/mods/public/simulation/components/ProductionQueue.js:794
    error: while searching for:
           else
           {
                   var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
                   this.timer = cmpTimer.SetTimeout(this.entity, IID_ProductionQueue, "ProgressTimeout", g_ProgressInterval, data);
           }
    };
    
    ProductionQueue.prototype.PauseProduction = function()
    {
           this.timer = undefined;
           this.paused = true;
    };
    
    ProductionQueue.prototype.UnpauseProduction = function()
    {
           this.paused = false;
           var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
           this.timer = cmpTimer.SetTimeout(this.entity, IID_ProductionQueue, "ProgressTimeout", g_ProgressInterval, {});
    };
    
    ProductionQueue.prototype.OnValueModification = function(msg)
    {
           // if the promotion requirements of units is changed,
    
    error: patch failed: binaries/data/mods/public/simulation/components/ProductionQueue.js:813
    Applying patch binaries/data/mods/public/simulation/components/ProductionQueue.js with 5 rejects...
    Rejected hunk #1.
    Rejected hunk #2.
    Rejected hunk #3.
    Rejected hunk #4.
    Rejected hunk #5.
    
     Patch Failed! 
    Usage Exception: Unable to apply patch!

     

    Anyone can provide some help on this?
     

     

    Thanks!

  7. @Stan`

    Hum... I thought so, but similar errors happen to my patch: and that one is quite recent...

    git apply -p . D2399.diff --reject

     

    Checking patch libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp...
    error: while searching for:
    #include <float.h>
    #endif
    
    #ifdef WIN32
    #define ecvt _ecvt
    #endif // WIN32
    
    #ifndef SAFE_DELETE_ARRAY
    #define SAFE_DELETE_ARRAY(ptr) if (ptr != NULL) { delete [] ptr; ptr = NULL; }
    #endif
    
    template <class Char, class FloatType>
    void FloatToString(FloatType f, Char* sz)
    {
    
    error: patch failed: libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp:18
    error: while searching for:
        int decimal, sign;
    
        // ecvt rounds the string for us: http://www.datafocus.com/docs/man3/ecvt.3.asp
        char* end = ecvt(f, digitCount, &decimal, &sign);
    
        if (sign != 0) (*buffer++) = '-';
        int count = digitCount;
    
    error: patch failed: libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp:34
    Applying patch libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp with 2 rejects...
    Rejected hunk #1.
    Rejected hunk #2.

    Is this process of "applying patches" any friendlier in SVN?

     

     

     

     

     

  8. ok. On a brand new 0ad git clone folder:

    I just tried git apply -p . D1592.diff --reject :

    D1592.diff:46: trailing whitespace.
     
    D1592.diff:88: trailing whitespace.
     
    D1592.diff:94: trailing whitespace.
     
    D1592.diff:127: trailing whitespace.
     
    D1592.diff:136: trailing whitespace.
     
    Checking patch libraries/source/spidermonkey/FixpsutilFreeBSD.diff...
    Applied patch libraries/source/spidermonkey/FixpsutilFreeBSD.diff cleanly.
    warning: squelched 1 whitespace error
    warning: 6 lines add whitespace errors.

    ok, this seems to have worked. Now moving on to

    git apply -p . D1593.diff --reject :

    Checking patch source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp...
    error: while searching for:
    
    void AtObj::add(const char* key, const wxString& value)
    {
    	add(key, value.wc_str());
    }
    
    void AtObj::add(const char* key, const wchar_t* value)
    
    error: patch failed: source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp:164
    error: while searching for:
    
    void AtObj::set(const char* key, const wxString& value)
    {
    	set(key, value.wc_str());
    }
    
    void AtObj::set(const char* key, const wchar_t* value)
    
    error: patch failed: source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp:187
    Checking patch source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp...
    error: while searching for:
    	else
    	{
    		wxString filePath = GetSelectedFilePath();
    		AtlasMessage::qVFSFileExists qry(filePath.wc_str());
    		qry.Post();
    		if (!filePath.IsEmpty() && qry.exists)
    		{
    			AtlasMessage::qVFSFileRealPath qry(filePath.wc_str());
    			qry.Post();
    			wxDynamicCast(FindWindow(ID_MapDialogFilename), wxTextCtrl)->ChangeValue(*qry.realPath);
    		}
    
    error: patch failed: source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp:166
    Checking patch source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp...
    Applying patch source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp with 2 rejects...
    Rejected hunk #1.
    Rejected hunk #2.
    Applying patch source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp with 1 reject...
    Rejected hunk #1.
    Hunk #2 applied cleanly.
    Hunk #3 applied cleanly.
    Applied patch source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp cleanly.

    @Stan` Do you know why these git conflicts are happening? What can be done to fix them?

  9. Yep, 

    so I have downloaded the diff file (D2399.diff) and saved it on my 0ad git base folder.

    when I do in the base git directory:

    git apply -p . D2399.diff

    I get:

    error: patch failed: libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp:18
    error: libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp: patch does not apply

    Does anyone know how to fix this?
     

    git version 2.24.0
    FreeBSD 12.1-RELEASE

  10. Thanks!

    I'll try to get arc to work on my desktop FreeBSD this weekend.

     

    Meanwhile here's the diff file (in case it's useful):

    diff --git a/libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp b/libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp
    index 272ab632e3..522be026e3 100644
    --- a/libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp
    +++ b/libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp
    @@ -18,14 +18,28 @@
     #include <float.h>
     #endif
     
    -#ifdef WIN32
    -#define ecvt _ecvt
    -#endif // WIN32
    -
     #ifndef SAFE_DELETE_ARRAY
     #define SAFE_DELETE_ARRAY(ptr) if (ptr != NULL) { delete [] ptr; ptr = NULL; }
     #endif
     
    +// The implementation of ecvt was taken from musl libc (musl/src/stdlib/ecvt.c)
    +char *ecvt_musl(double x, int n, int *dp, int *sign)
    +{
    +    static char buf[16];
    +    char tmp[32];
    +    int i, j;
    +
    +    if (n-1U > 15) n = 15;
    +    sprintf(tmp, "%.*e", n-1, x);
    +    i = *sign = (tmp[0]=='-');
    +    for (j=0; tmp!='e'; j+=(tmp[i++]!='.'))
    +        buf[j] = tmp;
    +    buf[j] = 0;
    +    *dp = atoi(tmp+i+1)+1;
    +
    +    return buf;
    +}
    +
     template <class Char, class FloatType>
     void FloatToString(FloatType f, Char* sz)
     {
    @@ -34,7 +48,7 @@ void FloatToString(FloatType f, Char* sz)
         int decimal, sign;
     
         // ecvt rounds the string for us: http://www.datafocus.com/docs/man3/ecvt.3.asp
    -    char* end = ecvt(f, digitCount, &decimal, &sign);
    +    char* end = ecvt_musl(f, digitCount, &decimal, &sign);
     
         if (sign != 0) (*buffer++) = '-';
         int count = digitCount;

     

     

     

     

     

  11. Hi Folks,

    Following https://trac.wildfiregames.com/ticket/1325#no1, which has not been updated in 6 years.

    I was trying to build 0ad on my FreeBSD desktop.

    I have successfully built FCollada using the musl libc implementation of ecvt(). Since musl libc is MIT licensed, would the following code be considered to be included on 0ad, as part of FUStringBuilder.hpp:

    char *ecvt_musl(double x, int n, int *dp, int *sign)
    {
    	static char buf[16];
    	char tmp[32];
    	int i, j;
    
    	if (n-1U > 15) n = 15;
    	sprintf(tmp, "%.*e", n-1, x);
    	i = *sign = (tmp[0]=='-');
    	for (j=0; tmp[i]!='e'; j+=(tmp[i++]!='.'))
    		buf[j] = tmp[i];
    	buf[j] = 0;
    	*dp = atoi(tmp+i+1)+1;
    
    	return buf;
    }
    
    
    
    template <class Char, class FloatType>
    void FloatToString(FloatType f, Char* sz)
    {
    	Char* buffer = sz + 1;
    	static const int digitCount = 6;
    	int decimal, sign;
    
    	// ecvt rounds the string for us: http://www.datafocus.com/docs/man3/ecvt.3.asp
    	char* end = ecvt_musl(f, digitCount, &decimal, &sign);
    
    	if (sign != 0) (*buffer++) = '-';
    	int count = digitCount;
    	if (decimal > digitCount)
    	{
    		// We use the scientific notation: P.MeX
    		(*buffer++) = (*end++); // P is one character.
    		(*buffer++) = '.';
    
    		// Mantissa (cleaned for zeroes)
    		for (--count; count > 0; --count) if (end[count - 1] != '0') break;
    		for (int i = 0; i < count; ++i) (*buffer++) = (*end++);
    		if (buffer[-1] == '.') --buffer;
    
    		// Exponent
    		(*buffer++) = 'e';
    		uint32 exponent = decimal - 1; // X
    		if (exponent >= 10) (*buffer++) = (Char) ('0' + (exponent / 10));
    		(*buffer++) = (Char) ('0' + (exponent % 10));
    		(*buffer) = 0;
    		return;
    	}
    	else if (decimal > 0)
    	{
    		// Simple number: A.B
    		for (int i = 0; i < decimal; ++i) (*buffer++) = (*end++);
    		if (decimal < digitCount) (*buffer++) = '.';
    		count = digitCount - decimal;
    	}
    	else if (decimal < -digitCount)
    	{
    		// What case is this?
    		decimal = count = 0;
    	}
    	else if (decimal < 0 || (decimal == 0 && *end != '0'))
    	{
    		// Tiny number: 0.Me-X
    		(*buffer++) = '0'; (*buffer++) = '.';
    		for (int i = 0; i < -decimal; ++i) (*buffer++) = '0';
    		count = digitCount + decimal;
    	}
    	for (; count > 0; --count) if (end[count - 1] != '0') break;
    	for (int i = 0; i < count; ++i) (*buffer++) = (*end++);
    	if (decimal == 0 && count == 0) (*buffer++) = '0';
    	if (buffer[-1] == '.') --buffer;
    	(*buffer) = 0;
    }

    I basically replaced the call to ecvt() by ecvt_musl().

     

    What do you guys think?

     

    Cheers

    • Like 1
×
×
  • Create New...