DarkPlacesEngine / darkplaces

GNU General Public License v2.0
263 stars 39 forks source link

I want .vis support #138

Open ghost opened 4 months ago

ghost commented 4 months ago

.vis files help to see transparent water properly on old maps.

Old maps are not vised for transparent water and in order to see transparent water in these maps either get their .vis files and use vispatch.exe to modify the map files (.bsp, .pak and etc) or set the cvar "r_novis" to "1" so that transparent water is rendered properly.

Gamers that play Quake with fteqw only need only the .vis files (neither vispatch.exe nor r_novis=1 is needed at all) because fteqw has .vis support which means that if fteqw finds the .vis files then fteqw automatically does the work that vispatch.exe does on the maps that fteqw loaded to memory.

DarkPlaces currently has no .vis support which means that either vispatch.exe in addition to the .vis files or r_novis=1 is required to render transparent water properly and I want .vis support for darkplaces so neither vispatch.exe nor r_novis=1 is needed, but only the .vis files exactly like in fteqw.

.vis support can ease the use of .vis files a lot without the need to use a script file, like batch, that executes vispatch.exe on every .vis and map file or sacrificing performance by setting the cvar "r_novis" to "1".

This is much more convenient, comfortable and saves time when the engine automatically does all the work for you and you don't need to manually use third parties and scripts, like vispatch.exe and batch, to do all this work for you.

Baker7 commented 4 months ago

It is a terrible idea for DarkPlaces because if you have start.vis in quake/maps folder, then when you play Hipnotic or Rogue start map also called (start.bsp), it tries to use invalid .vis file and causes engine issues (and the engine issue is CRASH).

This is the reason that Zircon does not have .vis support, there is no way to identify whether a .vis file is for a specific start map -- and tons of mods have their own start.bsp because Single Player -> New Game loads start.bsp.

The .vis feature for DarkPlaces is worse than the problem, and you would have stuff unpredictably not work or crash when you play quite a few mods.

Just download vis patched maps and problem solved.

ghost commented 4 months ago

It is a terrible idea for DarkPlaces because if you have start.vis in quake/maps folder, then when you play Hipnotic or Rogue start map also called (start.bsp), it tries to use invalid .vis file and causes engine issues (and the engine issue is CRASH).

This is the reason that Zircon does not have .vis support, there is no way to identify whether a .vis file is for a specific start map -- and tons of mods have their own start.bsp because Single Player -> New Game loads start.bsp.

The .vis feature for DarkPlaces is worse than the problem, and you would have stuff unpredictably not work or crash when you play quite a few mods.

Just download vis patched maps and problem solved.

I totally disagree with that because if you are correct then please tell me why fteqw does have this .vis feature at all then?

I will tell you why:

The command line can be used to identify whether a .vis file is for a specific start map

When I want to play Scourge of Armagon then I am starting the engine with the -hipnotic command line option, and when I want to play Dissolution of Eternity then I am starting the engine with the -rogue command line option and for any game that the engine can play I am starting the engine with the -game command line option specifying the name of the folder containing the game files, like .pak, .pk3 and etc, and the name of the folder is also the name of the game and if I want to play the original quake 1996 then I am starting the engine without specifying any game in the command line and then everything is loaded from the id1 folder in the base directory that can be specified in the -basedir command line option and if not then the start directory of the engine is used as the base directory.

When starting the engine with a command line option -hipnotic, -rogue or -game then the engine is supposed to load files from the folder that was specified/mentioned in the command line and if not found then try to load the files in the id1 folder. If the engine was started with a command line that does not specify/mention a game then everything is loaded from the id1 folder in the base directory.

For example if Zircon was started with the -hipnotic command line option then the start.vis in the hipnotic/maps directory will be loaded if exists and if not exists only then the start.vis in the id1/maps directory will be loaded if exists and otherwise use the vis information in start.bsp in hipnotic/maps or id1/maps directory.

Another example if Zircon was started with the -rogue command line option then the start.vis in the rogue/maps directory will be loaded if exists and if not exists only then the start.vis in the id1/maps directory will be loaded if exists and otherwise use the vis information in start.bsp in rogue/maps or id1/maps directory.

Another example if Zircon was started with the -game quake command line option then the start.vis in the quake/maps directory will be loaded if exists and if not exists only then the start.vis in the id1/maps directory will be loaded if exists and otherwise use the vis information in start.bsp in quake/maps or id1/maps directory.

If Zircon was started with a command line that does not specify/mention a game then try to load the start.vis file in the id1/maps directory and if the start.vis file could not be found in the id1/maps directory then use the vis information of the start.bsp file in the id1/maps directory.

In case the .vis file could not be found in the maps folder in the game directory (that was specified/mentioned in the command line) then I think that this is more rational to use the vis information of the .bsp file in the maps folder in the game directory instead of trying to find vis information in the id1 folder.

For example if Zircon was started with the -hipnotic command line option then if the start.vis file could not be found in the hipnotic/maps directory then this is more rational to use the vis information of the start.bsp file in the hipnotic/maps directory rather than trying to find the vis information for the start map in the id1 folder but I think that you got my point, there is a way to identify whether .vis file is for a specific start map by using the command line and I still think that this is a good idea.

Note that the quake/maps directory will be accessed only if the engine was started with the -game quake command line option.

Also how does Zircon knows which start.bsp file to load without reading the command line at all?

How does Zircon knows whether to load start.bsp file from id1, hipnotic or rogue folder without reading the command line at all?

hemebond commented 4 months ago

According to Spoike there are some numbers you can check to see if a .vis file is for a specific .map file.

ghost commented 4 months ago

According to Spoike there are some numbers you can check to see if a .vis file is for a specific .map file.

What do you mean? What are these some numbers?

hemebond commented 4 months ago

According to Spoike there are some numbers you can check to see if a .vis file is for a specific .map file.

What do you mean? What are these some numbers?

I'm assuming here are data (numbers) in the vis and bsp files that can tell you if they match. There is likely code in FTEQW to that effect. I don't know much more than this.

ghost commented 4 months ago

According to Spoike there are some numbers you can check to see if a .vis file is for a specific .map file.

What do you mean? What are these some numbers?

I'm assuming here are data (numbers) in the vis and bsp files that can tell you if they match. There is likely code in FTEQW to that effect. I don't know much more than this.

I understand.

I do believe that the vis feature can work with many different mods but the problem is that we don't know how to program the engine to use these .vis files properly.

A research needs to be done.

Fteqw is open source so I can view Fteqw's source code and learn how does Fteqw uses these .vis files properly and try to add it to darkplaces too.

If vispatch.exe is also open source then I can also study vispatch source code too to learn how to program darkplaces to vispatch the loaded map assuming the name of the loaded map is known then this is just a matter of finding a .vis file with that name in the maps folder of current game directory and use it as input to the vispatch function in addition to the current map (.bsp file).

Baker7 commented 4 months ago

According to Spoike there are some numbers you can check to see if a .vis file is for a specific .map file.

Thanks hemebond, I may put .vis support on the list to reimplement then and dig into fte to see what this check is ... the hard crashes when hipnotic and rogue and such with a id1/maps/start.vis was -- well, I removed .vis support after adding it due that issue.