Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Map-mods load mod while preview #3759

Closed
wzdev-ci opened this issue Oct 24, 2012 · 32 comments
Closed

Map-mods load mod while preview #3759

wzdev-ci opened this issue Oct 24, 2012 · 32 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by Reg312


Map-mods problem in RC3

Sorry if this problem was already mentioned somwhere

Steps:

  1. make map-mod with modified stats

  2. put map-mod in maps folder

  3. load WZ and try to preview map-mod in start game screen

(just move mouse on map-mod in l\ist of maps)

  1. select another map (without mod) and just play it

if you did not previeed map-mod then you can play another maps without problems (without mod loading)
result: mod loaded from modded map which you just previewed

this bug also results in MP
when players auto-kicked due to incompatible-mod

version 3.1 rc3


Issue migrated from trac:3759 at 2022-04-16 10:40:23 -0700

@wzdev-ci
Copy link
Contributor Author

vexed changed priority from normal to major

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 4, 2012

Cyp commented


Is there a specific map-mod I can test this with?

I tried making a map-mod with graffiti on all the tiles, but couldn't reproduce.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 5, 2012

Reg312 commented


Well, i've made map mod with some changes in stats

testing noticeable option - oli derrick with 100$ price (in original game derricka are 0$)

  1. Put attached file into map's folder

  2. Open start skirmish game GUI

  3. Preview map BeerNTW_vm4

  4. Select map sk_rush and start game

  5. Check price of oil derrick

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 5, 2012

Cyp commented


I still cannot reproduce — in step 5), the derrick is still 0$. I'm using Linux, and a patched (against #3700) physfs 2.0.2.

Which OS, and if Linux, which version of physfs are you using? Can anyone else reproduce?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 5, 2012

Reg312 commented


i'm using Windows 7 and i dont know anout physfs version

i use warzone from normal installation of version rc3

@Cyp try to load mooded map and play, do you see 100$ price of derrick in that map-mod?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Cyp commented


If playing the modded map, I see 100$ derricks.

If previewing and then playing a different map, I don't.

I tested both bugfixes branch and 3.1_rc3, both in single-player skirmish and multiplayer mode.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Reg312 commented


seem that is windows bug, i can reproduce this many times

also i tested on my onw windows build (vs2010) from latest master branch and bug was reproduced

may be you can point me to some place in code or i can try replace physfs lib or what?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Cyp commented


Think the rebuildSearchPath() function in src/init.cpp should be responsible for unmounting old maps, not completely sure.

Since 15c04ab10f87de89ca7dcae2813834bd1a03247b, the rebuildSearchPath() function in src/init.cpp mounts only the current map (if any), instead of mounting all maps (and map-mods) at once.

Previewing a map should load/mount map-mods, but then previewing or selecting another map should result in the map-mods being unloaded/unmounted again.

Maybe around there could be somewhere to start looking, not sure.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Reg312 commented


rebuildSearchPath() always process only 2 paths

..\Data].. with standard subdirectories (mp,base,mods\autoload etc.)
..Documents\Warzone2100 master\

i could not find paths related to map

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Cyp commented


From rebuildSearchPath(), should be the relevant code:

removeSubdirs( curSearchPath->path, "maps", NULL );

and

if (current_map != NULL)
{
	std::string realPathAndDir = std::string(PHYSFS_getRealDir(current_map)) + current_map;
	PHYSFS_addToSearchPath(realPathAndDir.c_str(), PHYSFS_APPEND);
}

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Reg312 commented


well i see

added value:
C:\Users\Vladimir\Documents\Warzone 2100 master\maps/10c-BeerNTW2_vm4.wz

removed value:
C:\Users\Vladimir\Documents\Warzone 2100 master\maps\10c-BeerNTW2_vm4.wz

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Cyp commented


That sounds platform-specific...

Maybe some kind of abuse of PHYSFS_getDirSeparator() when removing?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Reg312 commented


tried few things in debug

i think dirSeparator processed correctly

  • PHYSFS_removeFromSearchPath - actually removes items

@Cyp may be you can point me to place in code where results of PHYSFS search paths used to load stuff. i need method to watch current list of paths..

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Cyp commented


The '' probably comes from removeSubdirs() in src/main.cpp. There's also a addSubdirs() there.

No idea if hardcoding a '/' there would break other stuff.

I don't understand the '/' vs '' stuff (my system only uses '/'), so can't really help.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

Reg312 commented


  1. i think wrong separators is not problem and it processed correctly by Physfs
    (tested hardcode 'replace' and it did not helped

  2. how can i get another verision physfs, cause i getting error |07:30:41: [check_Physfs:567] You have PhysicsFS 2.0.2, which is buggy. You may experience random errors/crashes due to spuriously missing files.

  3. i dont see place in code in which i can check list of actual search paths...oh too complex for me 8)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 6, 2012

vexed commented


Replying to Warzone2100/old-trac-import#3759 (comment:15):

  1. i think wrong separators is not problem and it processed correctly by Physfs
    (tested hardcode 'replace' and it did not helped

That shouldn't cause any issues.

  1. how can i get another verision physfs, cause i getting error |07:30:41: [check_Physfs:567] You have PhysicsFS 2.0.2, which is buggy. You may experience random errors/crashes due to spuriously missing files.

You need to compile 2.0.3 yourself.

  1. i dont see place in code in which i can check list of actual search paths...oh too complex for me 8)

Do --debug=all (maybe --debug=wz) to see paths and what it mounts / unmounts.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 7, 2012

anonymous commented


probably related:

  1. install RC3 (on Windows 7)
  2. start game, choose single player challenge: you only see the three "standard" challenges to choose from in the menu
  3. go back to main menu, choose single player skirmish, select maps, mouse hover over maps, e.g. "Cataclysm", but select different map
  4. go back to main menu, choose single player challenge: you now can choose "Cataclysm" as well

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 8, 2012

Reg312 uploaded file WZlog-1108_223603.txt (1120.5 KiB)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 8, 2012

Reg312 changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Nov 8, 2012

Reg312 commented


attached log with debug=all
actions hs made to produce this log:

  1. preview map-mod (BeerNtw_vm4)
  2. Start game on NoQ'a map "Metalcity"

Where i can download Warzone release for windows with another version of PhysicsFS?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 5, 2012

NoQ changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 5, 2012

NoQ commented


anonymous: nice catch, btw. I always wondered why challenge maps have stopped working since 3.1_beta11, together with installing ai mods into maps folder. This leads us straight to the time interval between beta10 and beta11, and also an easier way of reproducing the bug (if it's actually related).

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2012

Reg312 commented


Tested this bug on latest bugfixes build from BuildBot from 6-december-2012
Bug still present
I guess bugfixes branch now using different version of PHYSFS?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Reg312 commented


just noticed oil derrick already have 100$ in master, so my debug probes was wrong :(
now i'm sure problem is wrong directory separator!

i dont know how fix it with sanity, spent hours on it

tried following:

std::string realFileName = std::string("maps/") + *i;
std::string realFileName = std::string("maps") + std::string(PHYSFS_getDirSeparator())+ *i;

  • with this replacement PHYSFS_getRealDir stopped work... may be i had to find all places where dir_separator used in paths...

so i made bad patch, but it works for me on my crappy windows

EXPORT int PHYSFS_addToSearchPath ( const char * newDir,
int appendToPath
)
newDir - directory or archive to add to the path, in platform-dependent notation.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Reg312 changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Reg312 uploaded file 0001-1.patch (1.1 KiB)

bad patch

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Per uploaded file cleanmadpathcode.diff (4.0 KiB)

I wonder if this patch makes any difference. At least it will clean up some very crazy, related code.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Reg312 uploaded file 10c-BeerNTW2_vm4.2.wz (34.2 KiB)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Reg312 uploaded file 10c-BeerNTW2_vm4.wz (34.2 KiB)

Map-mod for debug&test

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Per changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Per changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2012

Per commented


Fixed in 1fd7036f25949dfd465e8ac2e694f7c32c63f6cf

@wzdev-ci wzdev-ci closed this as completed Dec 8, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant