Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Guest DILDOMASTER666

WindowCaster: The Shadowcaster Source Port

Recommended Posts

Guest DILDOMASTER666

WindowCaster is, to my knowledge, the first attempt to create a Windows-native port of Shadowcaster. It is built with Game Maker: Studio and the objective is, upon 1.0 release, to read all game data from their associated archives and externalize as much of the game code as possible to human-readable files. If this is insufficient for the user to create their mod of choice, then a project source file containing the entire engine will be made available at a later date, allowing for complete and fundamental modification of the game in every way.

 

Release Timeline:

  • Currently: map editor. a few gameplay elements, but there is still a long way to go.
  • Next release: more gameplay elements and expanding the editor.


Screenshots:

Spoiler

caster42.png.b98e3fe8883b31b5cb8b0c61e33f703e.pngcaster43.png.9297c00afb799b88700aa59e273269f7.pngcaster44.png.fad0f93f65a44e3de89be9a6d5633942.png

 

Current features:

  • Functions as a Shadowcaster level viewer
  • Renders the game at up to 2560x1080
  • From-scratch Direct3D renderer
  • Functional player morphing (use the number keys)
  • Mouse- or keyboard-based navigation controls
  • Easily portable to other platforms (courtesy of Game Maker)
  • OGG music support
  • Externally scripted
  • PK3 mod loading support
  • map editor

 

Planned features:

  • in-engine  level  and resource editor
  • externalized scripts for most of the game and engine code
  • the ability to statically link a mod to the executable at compile-time (create your own games using the engine)
  • full support for Shadowcaster 1.12F (floppy version) and Shadowcaster 1.01F (CD version)

 

Downloads:

version 0.25-PRE-7 (current)

Source Code

OPL Music Pack

WindowCaster Example Mod

 

Historical versions:

version 0.25-PRE-5

version 0.25-PRE-3

version 0.25-PRE-2

version 0.20.5132

version 0.10.2b0e

version 0.10.0459

version 0.10.8636

version 5a85bbad

version 5a856963

version 5a85151f

 

Changelog:
 

Spoiler

ver. 0.25-PRE-7 to ver.0.25-PRE-4:

  * these were mostly debugging releases released over Discord and to certain specific people to test the map editor functionality.

  * various small backend improvements to support the editor.

  + added map editor.

 

ver. 0.25-PRE-3:
  * modified the way internal .dat textures are handled to support transparent pixels (for doors, cobwebs, etc)
  + *.dor files are loaded. this is preliminary, the format is not completely known at this time. the doors themselves can be used, but have no lock information, so you can just open every door in the game for now... including ones you aren't supposed to, like cobwebs.
  + added positional audio playback. you can test this by opening doors.
  + added support for GZDoom-style dynamic lights. this feature is disabled by default(the macro "R_ENABLE_LIGHTING" toggles this).
  + added support for global directional lighting, which simulates Doom's "fake contrast" on walls of different angles. the resulting effect is like ZDoom's "smoothlighting" option. this is also disabled by default, togglable with R_ENABLE_LIGHTING.


ver. 0.25-PRE-2:
  * first open-source release.
  + added back music playback support and exposed the appropriate key for mapinfo to define which song to play on each map.
  + added support for reading two types of graphic lumps from RAVDATA.DAT (for walls and flats).

 

ver. 0.25-PRE-1:
  * internal debug release.
  - due to the extreme changes to the way textures are handled, animated textures and flats have been temporarily disabled.

 

ver. 0.20.5132:
  * completely rewrote the entire map loading code so that it can be more easily modded. this constitutes a refactor of something like 30% of the entire codebase.
  + added tile definition support.
  + added mapinfo support.
  - temporarily removed music playback in maps (involves a mapinfo bug).

 

ver. 0.10.2b0e:

  * physics were finally fixed. it was technically "working" in pre-0.10 but had to be rewritten from scratch once the internal map "format" changed for the 100th time and became more or less final.
  + added mouselook.
  + finally finished the audio support mentioned in 5a85151f's log.
  + added preliminary mod support. Currently, the only things exported are the music and the floor tileid script. more will be exported from the engine in future versions.

 

ver. 0.10.0459:

* fixed a pretty major surface cache issue with 0.10.8636 that could cause considerable memory leaks if you changed the screen size more than once.

* fixed a related but different, less critical issue with the surface cache: in 8636, the game would only render at 640x400 and upscale. now the game should accurately determine the internal resolution to render at.

 

ver. 0.10.8636: proof of concept release.

* most of the work in this version has gone into renderer backend improvements and the expansion of CA_ConstructMapDebug. as of now there is only one level in the floppy version that decodes into memory incorrectly. investigating a fix for that. in the mean time, while all levels from the floppy version are now accessible, most tile definitions do not exist yet so they will be broken.

* the rendersurface is now managed in a much cleaner way, so i enabled screen resizing. the game will not run in fullscreen yet, but you can resize the game window to any size. it will try to keep the game aspect ratio consistent for you, letterboxing where appropriate.


ver. 5a85bbad:
  * vastly expanded upon CA_ConstructMapDebug. it's still a long way from done, but you can visit all levels from the floppy version now. please do not try the cd version yet, as ConstructMapDebug still relies on raw offsets into the lib file.
  * preliminary mapping of cellcontent objects to tileids. ruinsa, ruinsb, and ruinbwat are just about done, and vestetst has some limited mappings so  you can at least look at it, sort of.
  + cell ceiling rendering. there are no mapped objects that use it yet.
  + in ver. 5a856963, i forgot to mention that for now, all graphics are statically linked to the executable.
  - removed some unused data from the executable.
ver. 5a856963:
  * upturned the renderer and did a lot of back-end work. it should now more closely resemble the original game's rendering.
  + you can now, in theory, load any level from Shadowcaster. however, since lots of tile definitions are still missing, only ruinsa and ruinsb are accessible.
  - made ruinbwat inaccessible. for now.

ver. 5a85151f:
  * completely rewrote the collision detection from scratch. it is now objectively 200,000 times better than the old code.
  + preliminary audio support. not finished and not accessible now.
  + maps can be loaded via CA_ConstructMapDebug(), if you know the offset to the map file in the lib.
  + morphing works, but not all forms are accessible right now. you can currently change to human, Maorin, Caun, Opsis, and Kahpa.
  - got rid of the old map data that was statically-linked in the exe. as above, the game now reads maps directly from the libs and creates cell content instances as necessary.

 

 

Known bugs:

  • the in-game pause menu is bugged badly.
  • sometimes doors are loaded from user maps in such a way that they may crash the game when viewed.
  • by morphing at specific times, the player can clip through the ceiling in some levels.
Edited by DILDOMASTER666 : new version available, source code update

Share this post


Link to post
Guest DILDOMASTER666

Version 5a856963 is now available. Download is in the first post, where you can check the text file for a detailed changelog and all the controls you'll need to play around.

Share this post


Link to post

I've never played Shadowcaster, but this might end up being my first experience with the game, at least when a full release comes out.

Share this post


Link to post

Thanks for offering an eary peek at your source port. I just gave it a try and walked around the two maps for a while. Without sprites and sounds, there is obviously hardly any gameplay going on. Nevertheless, I think it is still quite an accomplishment to be able to render these maps natively under Windows without having any access to the original source code.

I didn't find an option to resize the window or to go full screen. Is such a feature in the plans?

Share this post


Link to post
Guest DILDOMASTER666

It would be very easy to add such a feature, yes. I just didn't worry about it very much since it's in such an otherwise early state. I'll add window resizing for next release.

Share this post


Link to post
13 hours ago, DILDOMASTER666 said:

I'll add window resizing for next release.

Great, thanks! I fully understand that in this early stage window resizing is not a must-have among the dozens and dozens of other functionality/features that could be added. It's just that on my laptop screen the game window has roughly the size of a postcard, which triggered the question.

I'm looking forward to seeing more of this source port in the future. Good luck!

Share this post


Link to post
Guest DILDOMASTER666
8 hours ago, Arno said:

I fully understand that in this early stage window resizing is not a must-have among the dozens and dozens of other functionality/features that could be added

Seems pretty useful to me. ;) New version added with view resizing support. You can now visit every level from the floppy version, though most tilemap ids are not yet mapped to GM objects, so while every level (except one) loads correctly, they aren't very interesting to look at just yet. A few have all their walls and flats mapped correctly. The proof of concept is there; I just need to do the hard work of poking around with the "X" command and figuring out all the tileids.

Share this post


Link to post

Nice to see the world of Shadowcaster coming alive bit by bit. With a crispier image than ever before, due to the higher screen resolution.

 

BttXGuTh.png

Share this post


Link to post
Guest DILDOMASTER666

There were some serious issues with the surface management of the previous version, which manifested two bugs: the game would eat up unreasonable amounts of memory (2+ GB in the worst instances) in certain instances, and the game always defaulted to 640x400 internal resolution. This is no longer the case with 0.10.0459. Since this is a critical issue, I uploaded a new version ahead of schedule (I wanted the next release to be able to view all levels correctly). As a slight bonus, a lot more cell ids are known, so more levels -- but not all of them -- will load and render mostly properly.

Share this post


Link to post
Guest DILDOMASTER666

The first post has been updated with a new version. The engine is now scriptable with external files, which may be stored in pk3s like ZDoom. Additionally, OGG music support is back and as an added bonus, it can be included in a mod pk3 too. To this end, I have uploaded an example mod to show how this is done, and an OGG music pack which you should either rename to "mod.pk3" or place the raw folder in your WindowCaster appdata directory to enable.

 

EDIT: Regarding the next release, I am looking into exporting the wall and ceiling databases to the pk3s as well as the WindowCaster equivalent of "mapinfo". The script interpreter is very slow though, so don't expect the entire game to eventually be exported - what I export to scripts will depend on how much of a performance impact doing so would incur.

Edited by DILDOMASTER666

Share this post


Link to post

Robert W. Morgan III, one of the developers of In Pursuit of Greed, suggested that ShadowCaster runs on a modified Wolfenstein 3-D engine called the Raven engine, and released the version of Raven engine (for educational purposes) that Channel 7/Mind Shear Software received for the development of Greed. This version is available, along with the Greed source, from his website.

 

Maybe this could somehow help you with your project.

 

On another note, all screenshots shown above are without aspect ratio correction, does the recreation have this option?

Share this post


Link to post

The Raven engine is pretty well-known in these parts (see https://doomwiki.org/wiki/Raven_engine ). Unfortunately one of its features is that the core engine is mostly just the renderer and resource management stuff, and nearly 100% of the game code for the games that utilize it is not shared. This means that outside the basics, the IPoG source isn't that much help with figuring out the specifics of Shadowcaster.

Share this post


Link to post
Guest DILDOMASTER666
8 hours ago, MrFlibble said:

On another note, all screenshots shown above are without aspect ratio correction, does the recreation have this option?

Not yet. That is a planned feature in a future release, after the "extended menu" is finished. Probably not next release.

 

While the source code to the Raven engine is not absolutely 100% going to solve the problems WindowCaster faces (the renderer is completely Direct3D anyway), it is certainly an interesting peek into the engine. Thanks for sharing.

 

edit: this source code contains a level editor and resource editor??? that was unexpected

Edited by DILDOMASTER666

Share this post


Link to post
Guest DILDOMASTER666

Apologies for the the thread necromancy. This is still actively being developed. As most of the work over the past few months has been back-end and cleaning up the awful codebase, I have only one major new feature to add.

 

caster3.png.680aba6c303f14d112345728e43d9aa8.png

 

Textures and sprites can now be loaded from pk3s and can be assigned to arbitrary cell values using external scripts. This feature is very broken at the moment, but I hope that it will be ready for actual use next release. This new script format will also be adopted by the "mapinfo" equivalent system. It is very simple and uses section-key-value format, exactly like ini files:

[walls]
0 = "-1"
1 = "badflat.png"
2 = "stone1.png"
//etc...

[flats]
0 = "-1"
1 = "bigrock.png"
2 = "sewer3.png"
//etc...

[mapinfo]
thismap = 5
nextmap = 7
watermap = 6
music = "g_ruins1.ogg"
//etc...

I will post an actual release when these features are complete.

Share this post


Link to post
Guest DILDOMASTER666

https://www.dropbox.com/s/wh1eq3rqj4ec373/WindowCaster_0_20_5132.zip?dl=0

 

New version. From changelog:

ver. 0.20.5132:
  * completely rewrote the entire map loading code so that it can be
    more easily modded. this constitutes a refactor of something like
    30% of the entire codebase.
  + added tile definition support. (all vanilla sc maps should fully render correctly.)
  + added mapinfo support.
  - temporarily removed music playback in maps (involves a mapinfo bug).

This will hopefully be the last version that contains no real gameplay.

Share this post


Link to post
Guest DILDOMASTER666

Version 0.25-PRE-2

Version 0.25-PRE-2 source code

 

Interim release. This should not be considered a "real" update - this release is as-is for convenience purposes so you do not have to build the source in GM to see what has changed so far. Now that 99% of the Shadowcaster graphics and data that were statically linked to the executable have been removed, I feel much more comfortable releasing the source project behind it. It is designed with Game Maker: Studio 1.4.1804.

 

Be warned: this does not mean my code is at all good or pleasant to look at. It will compile and run as-is without modification, but keep in mind that I am the only person I expect to be able to follow what's happening at this point in time.

 

From changelog:

ver. 0.25-PRE-2:
  * first open-source release.
  + added back music playback support and exposed the appropriate key
    for mapinfo to define which song to play on each map.
  + added support for reading two types of graphic lumps from RAVDATA.DAT
    (for walls and flats).

Texture definition files (tile_floors.ini/tile_walls.ini) and external PNG graphic replacements are still allowed using the same method from 0.20.5132.

Share this post


Link to post
Guest DILDOMASTER666

A new feature I've been working on for the "real" 0.25 release.

 

caster26.png.5cb690187335817c801b040fc5cfda38.png

 

GZDoom-style dynamic lighting in a scene can be toggled on or off at any time. There is a hard limit of 8 lights which can be visible at a time (with no prospect of expanding on this limit), which are managed automatically with excess lights simply not being drawn until previous lights are dropped from the list. By default, this feature will be disabled in vanilla maps.

Share this post


Link to post
Guest DILDOMASTER666

New pre-0.25 release. As before, it is not important that you update immediately. The new test version contains positional audio playback, doors, and some patches to the way G_LoadWall/G_LoadAllWalls work. Dynamic lighting is included in this release, but disabled by default. In order to test this feature, you must manually place light objects in the room "levelarena" and set R_ENABLE_LIGHTING = true in the GM Macros editor.

Share this post


Link to post
Guest DILDOMASTER666

New pre-0.25 release.

 

This version contains a map editor. Check the readme for details. This release was not planned, but I figured since I had basically finished the backbone of the editor it would be smart to test it out publicly. Please inform me of any bugs you find, show me your creations, or just give me your opinions on how the interface should expand or change.

 

I would also like to ask the community for your opinions regarding a text-based map format for WindowCaster, similar in concept to UDMF. Binary maps will continue to be supported and I will do my best to enable writing your own .lib files, with the objective of being compatible with the original DOS executable.

 

If there is interest, I would also like to consider creating a Discord server to discuss future developments of this "source port" since I am sure one Discord server in particular is tired of hearing about it.

 

ver. 0.25-PRE-5

ver. 0.25-PRE-5 source code

Edited by DILDOMASTER666

Share this post


Link to post

Have you looked at ECWolf's UWMF? It's basically UDMF for Wolfenstein 3D. It seems it'd be a good starting point since both are tile-based.

 

Do you use an online repository like GitHub, GitLab, or BitBucket?

Share this post


Link to post
Guest DILDOMASTER666

I use GitHub, but not for WindowCaster - I doubted anyone was that interested in the source code.

Share this post


Link to post
Guest DILDOMASTER666

Possibly buggy update that allows you to save/load custom maps. No pk3 update needed. Press F5 to save to filename or F6 to load from filename while the editor is running (M key). Maps are saved to %appdata%/WindowCaster/Maps.

 

The files it generates are text files, with a format loosely similar to UWMF/UDMF.

Share this post


Link to post
Guest DILDOMASTER666

Patched version of 0.25-PRE-6.

 

The version I posted above has some nasty flaws. Please use this version instead, and please feel free to post any maps you make with the editor here. I would love to see them, especially if they expose any bugs in the editor.

 

Example map.

Edited by DILDOMASTER666

Share this post


Link to post
Guest DILDOMASTER666

New version.

 

This version includes some fixes for various bugs in the map editor and adds door editing mode, but be aware that while maps will save properly, doors do not always get saved or loaded properly. This will require several changes in the way doors are handled by the engine and those changes should be ready for the next pre-release, whenever that is.

 

Go here if you want to talk about WindowCaster or give me bug reports or whatever.

 

EDIT: Source code updated.

Edited by DILDOMASTER666

Share this post


Link to post
Guest DILDOMASTER666

Version 0.25 released.

 

This version correctly loads most static map objects and loads some of the .arc/.crt and .itm data, but due to my lack of a clear understanding of how these three formats work, only placeholder sprites are loaded. In addition, 3D collision detection with non-wall objects works. Mostly.

 

Next up:

- A rewrite to the texture manager, again. The current implementation has proven problematic when dealing with animated textures and this is also one of the big reasons doors do not save correctly in the text map format (all textures need a textureID linking them back to the TextureManager.TextureReference map, but no such mechanism exists in the engine at the moment to determine what textureID a door has - they only keep a "pointer" to the pixel data. walls and floors do this via the global.mapbuf_tile_* arrays, but no array of this type exists for doors).

- I think at some point while developing this version, I introduced a bug in the music playback system. There was always a hidden bug in music playback where the engine would attempt to destroy a nonexistent stream (in other words, stop .ogg playback for a .ogg that was not being played), but something I did seems to have broken it for real. Investigating a fix.

- A partial renderer rewrite. The way things work right now is naive - every polygonal surface has its own draw step which involves a texture and height lookup per object. I am not satisfied with this. The plan is a system that dynamically groups visible surfaces based on their texture and iterates through them, minimizing the amount of time spent looking for a texture resource and determining its dimensions.

- Over the long term, I will be rewriting the way cellcontent works so that more varied features are allowed, such as variable height floors and ceilings and sloped cells.

 

Source code.

Edited by DILDOMASTER666

Share this post


Link to post

Earlier this year I had a brief chat with the author of WindowCaster. He told me the project is on hold, due to difficulties with figuring out the mapscripts. He did plan to continue working on it at some point.

In any case, the source code is published on Github. All the reverse engineering done so far in this project might be of value to others.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×