Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - SleepKiller

Pages: [1] 2 3 ... 11
1
SWBF2 Modding / SleepKiller's SWBFII Shader Patch - WIP
« on: December 27, 2017, 06:38:41 AM »
So I've been making thing for SWBFII. This time it is using the shader toolkit I previously and a bit of cheeky DLL hijacking (like ENB or ENB esque mods) to hook into the Direct3D 9 run time. By injecting some metadata into the compiled shaders using a modified version of the compiler I made for the toolkit I can identify and make sense of the game's rendering pipeline in code. All without ever touching the game's executable or any of the ones it shipped with. (Which means as best I can tell this is not in violation of the EULA.)

So what does it do? Well currently it does some basic things that may seem dull but still provide notable improvements to visual fidelity without (hopefully) affecting the game's or any mods art style/direction. 

Borderless Fullscreen Windowed Operation   
Per-Pixel Lighting for Most Things
Per-Pixel Fog for Most Things
Derpy Proof-of-Concept Soft Shadows

Let's go through what some of those do and look like. Ideally I would just have side by side before and after pictures but there is only so much time in a day.

If you go here you can see the soft shadows. The idea here is quite simple, soft shadows usually look nicer than hard edged stencil shadows. (Hard edged stencil shadows could of course be used to great artistic effect in a game's art style and that is a very interesting topic for another time.) In this case I am simply blurring the shadow map before it's sampled this is in no way physically correct and does cause artifacting in certain places. But more importantly than those in most cases in looks nice. Eventually I would like to see about using different techniques like depth aware blurring to boost the quality and remove some of the artifacting. (And maybe even though in some form of Ambient Occlusion as well.)

Next here we have a poor example of the per-pixel lighting. You can see how the lighting more accurately and smoothly interacts with the storm troopers armour by fading at more correct angles. A better example would be on meshes that have low-tessellation (triangle count) over a large area. In those circumstances you can clearly see individual point lights interact correctly with the surface by fading out correctly and smoothly. Shoot a bunch of lasers down a hallway or a sniper bolt at a flat wall to see this effect.

Finally for now here you can see the per-pixel fog. Now I'll level with you, this was implemented primarily out of need. I had to ditch Shader Model 2 in order to get per-pixel lighting globally enabled. This killed the fixed function fog the game used which meant I had to re-implement it in shaders myself.

While doing this I made a couple improvements because A. Why not? and B. It is was easier to. The fog is now range based which means that objects will fade based of their world position not their perspective position, which creates less visual anomalies and is also closer to how fog works. The second is that fog is calculated per-pixel which is more expensive but gives a much nicer result as individual pixels have their fog coverage determined individually based of their distance. You can see this in action in the screenshot.

Some features I would like to look at adding are...

Soft Particles (maybe hard to integrate well into the game, but it would be really nice if they could be)
Improved Water and (maybe) Ocean Effects
Improved Refraction and Blur Quality
Improved HDR Rendering (currently normal maps can have their detail washed out before they're blended with their diffuse maps, some form of improved HDR rendering could fix this)
Order Independent Transparency (fixes things like command posts appearing behind glass)
(maybe) Depth-of-Field
(maybe) Other things I'm forgetting right now...

Be sure to give me your thoughts and say if you're interested in this! Or even better test it out, you'll obviously need an adequately capable GPU to run it. (If you have a DirectX 10/11 Feature Level GPU you are probably fine to give this a go.)

To install the current (early, likely unstable, don't be surprised if it crashes on you) version of it download and extract the contents of the folder below to your GameData folder. You should see dinput8.dll in the same directory as battlefrontII.exe.

Current Version (Backup your core.lvl before installing!)

The source code is of course coming soon. (That is as soon as I clean up the projects structure and write a readme.)

As a heads up, I can imagine some anti-viruses flagging this because of how it works (DLL Hijacking). It isn't, or at least it shouldn't be (if someone hijacked the web page they could trick you into downloading a version that was a virus, although that probably won't happen (but it could (although it probably won't, but still, it could))). Anyway the point is it is (probably) no more likely to be a virus than anything else you download from this site. But since it is a DLL if you're not comfortable installing that beside your game then that is highly understandable and I don't blame you for potentially giving it a pass.

2
Released Assets / SWBFII HLSL Shader Toolkit
« on: November 29, 2017, 04:16:51 AM »
As some of you likely know I've been working on this toolkit for a few weeks now and I feel it is now reasonably complete. It allows you to write shaders for the SWBFII in HLSL and have those shaders target either Shader Model 2.0 or Shader Model 3.0. See the readme for more information.

To install and use this you'll need to download or clone the repository from GitHub. Put it into the root of your BF2_Modtools folder. The folder structure should go BF2_ModTools -> shader_toolkit -> src.  Not BF2_ModTools -> shader_toolkit   -> shader_toolkit -> src. After that you can bootstrap the toolkit or you can download this which is a shader_toolkit folder containing a build folder for you to copy into the shader_toolkit you got from GitHub.

After that simply see the Getting Started in the readme for how to use the tool!

GitHub Repository
Prebuilt Compiler and Pre-extracted Premunged Files
Prebuilt core.lvl containing the New Shaders

3
SWBF2 Modding / A HLSL Shader Toolkit for SWBFII - WIP
« on: November 01, 2017, 05:05:30 PM »
I posted a bit about this in the WIP forever... thread recently but now in order to hide from tracking down a bug I've decided to make a proper WIP thread. How nifty!

This is another one of my fun hobby projects relating to SWBFII, which for some reason I find endlessly enjoyable to mess with. The idea is fairly straight forward writing shaders in assembly sounds hard and painful, writing shaders in HLSL sounds hard and painful. But since HLSL is easier to read and write itself I thought it would be nice to be able to edit the game's shaders in it. Thus enters this project to create a build process to compile and munge HLSL shaders and use them in SWBFII instead of the stock assembly ones.

The build process is all but complete and now I am just slowly porting the shaders one by one to HLSL. I've never programmed in HLSL (I'm a GLSL man personally) before and I'm not a graphics programmer (I barely qualify as any form of "programmer" tbh) by any means so it is a challenging process for me. But regardless of that I have been making good progress on it reasonably consistently and I kind of felt like seeking out what interest there was in the small SWBFII community for this. Although I am just making it because I want to edit the shaders myself it's still helpful to know how many (if any) people are interested in it. Hence a WIP thread.

Screenshots would be dull since at this stage if everything is progressing fine and working correctly you can't tell the difference between my rewritten shaders and the game's stock ones. So have some code to look at instead of here.

Although I did have some fun with the rain shader a couple days ago. Isn't it pretty?

4
Released Assets / Scripts to replace BFBuilder
« on: October 26, 2017, 01:32:07 AM »
Seeing the need of sereja I spent some time today to create these. They're simple scripts that can create functioning world project folders and add new sides to those project folders.

To install drop them in root folder of your modtools installation. (That is the one with Assets, BFBuilder.hta, Data, DataTemplate, etc in it.)

Usage is simple, double click on add_world.bat to launch it, it will ask you to enter some information about the new world. (Type it in and press Enter.) After which it will create the project folder for you. To add a side to the same except launch add_side.bat.

The scripts are written in batch and VBscript, so I believe it should run on virtually any computer capable of running the modtools. I however make no promise that they're perfect but they seem to get the job done. If you do run into problems however feel free to let me know.

5
Released Assets / model-edit - v0.1.1
« on: August 04, 2017, 04:16:05 AM »
This here is a tool for editing detail information in a .model files produced by modemunge. It'll work (or it should) on any PC SWBF1/SWBFII .model file.

For usage instructions, information on how it works and more see the readme on GitHub.
https://github.com/SleepKiller/model-edit#model-edit

For a copy of the tool see the release page on GitHub.
https://github.com/SleepKiller/model-edit/releases

To learn about the workings on the tool see the source code on GitHub.
https://github.com/SleepKiller/model-edit

I made this over the course of this evening, it's not super advanced but it gets the job done. I wrote it in C# because  I wanted to play around with another language after writing swbf-unmunge in C++.

This also has to be the laziest release topic I've ever posted on this site.

6
SWBF1 Modding / Getting detailed models ingame experiments.
« on: July 25, 2017, 07:45:07 AM »
This topic is one I posted in the requests board and have since hijacked now talk about experiments of getting detailed models ingame.

Spoiler: Original Post (click to show/hide)

7
Released Assets / swbf-unmunge - v1.0.1
« on: July 06, 2017, 11:20:57 PM »
This here is a tool for reversing the munge process. It doesn't work 100% correctly and isn't finished yet but it can get a lot out of .lvl files.

Now before I go any further let me stress this I'm making this in my spare time for fun because I find it interesting to work on. I did not make with the intent of using it to get access to other modders assets without their permission. If you want to use it on a map another modder made to learn how they did something then that is probably fine, but if you want to use it so you can use something of their's without asking then that probably isn't okay. But I digress a tool is a tool, it isn't inherently evil or good. I know I would have loved to have this a few years ago when I lost one of my maps to the abyss and only had the .lvl of it.

While it does a good job in my tests on SWBFII files at getting stuff back it makes no effort to get it into a ready to munge state. If you want to munge a map you extract using this tool you'll still need to do some work, in this regard I will offer little to no help. Some file names will be wrong, some files will need fixing up manually and all the .req files will need to be recreated by hand.

It's a commandline tool, so you'll need to know how to use those in order to do that. If you need help RepComm has made up for my laziness (a recurring pattern with this tool) written up a reasonably comprehensive guide here http://www.swbfgamers.com/index.php?topic=12452.0. (I say reasonably because it doesn't cover 'explode' or 'assemble', but those are likely of little interest to most people anyway.)

Find the source code on GitHub
https://github.com/SleepKiller/swbf-unmunge.
And hey would you look at that you can always find the most recent release on GitHub as well, isn't GitHub amazing.
https://github.com/SleepKiller/swbf-unmunge/releases.

If you would like a GUI for it you find one made by RepComm here. I haven't used it myself but it looks pretty solid, you will need to install Java though if you don't have it.
https://github.com/RepComm/SWBFUnmungeGUI/releases

If it crashes for you, hangs, says "Exception Occurred" or produces bad output feel free to tell me. Don't forget to say which file you were using it on.

8
Star Wars Battlefront II / SWBFII Split Screen Toolkit
« on: October 24, 2016, 12:22:37 AM »
This is a little something I have been working on for fun recently. It enables people to play Star Wars Battlefront II in a split screen mode on PC.

Spoiler: Image (click to show/hide)

Requirements
   As many XInput compliant controllers as you wish to have players. PS3 or PS4 controllers will work fine if you use something like SCP Toolkit.

   At least Windows 7, though I haven't tested it provided you have the runtimes below it should work.

   Non-Steam Version of SWBFII, the Steam version will not work unless you replace BattlefrontII.exe with the SWBFSpy version of the client.

   If you're lazy and on Windows 10 only bother downloading them if you get a "Runtime error" or something to that effect, the operating system may very well take care of getting dependencies for you.

   The core application requires Visual C++ Redistributable for Visual Studio 2015
   https://www.microsoft.com/en-nz/download/details.aspx?id=48145

   And the GUI requires .NET Framework 4.6.1 which you can get here.
   https://www.microsoft.com/en-nz/download/details.aspx?id=49981

   Optionally you can also install the SWBFII dedicated server software and use that for lower loading times.
   http://www.swbfgamers.com/index.php?topic=10619.msg106046#msg106046

Installation
   Copy all the contents of zip to the directory where your BattlefrontII.exe is.
   This is usually "C:\Program Files (x86)\LucasArts\Star Wars Battlefront II\GameData"

   Do not get BattlefrontII.exe confused with LaunchBFII.exe, if you don't see BattlefrontII.exe you're in the wrong place.

Usage
   Once installed simply start Split Screen GUI to configure and launch your play session. All the controls should have tooltips to inform you what they do.
   
   The map list supports common Windows controls like Double Clicking to add a single map, holding Control to select multiple items and drag-droping selections.

   The tool uses a pre-created profile to give you controls almost identical to the console version of the game. If you want to rebind them you'll have to set a player's name to SplitScreen using the GUI, or commandline tool, and rebind the controls using that player's screen. Once you've got them how you want exit and start the split screen session again to update the controls across all players.

Technical Overview
Spoiler (click to show/hide)

Change Log
Spoiler (click to show/hide)

Download it here! (Current Version 1.0.4)

If you do use it be sure to let me know how it goes and feel free to ask questions, especially if you encounter strange behaviour.

9
Released Assets / My Modtools Folder(s)
« on: August 06, 2015, 10:04:49 PM »
I went through and archived all my old modtools folders from my various PCs over the years. I figured I may as well release them on the off chance someone would find them interesting.

Since these are my entire modtools folder where I kept everything there will others assets in there. (Particully in the 2012 folder) I recognize that I should have properly documented what was mine and what wasn't at the time I did it properly, but I don't see much harm in releasing them since I think that for the most part authors are credited (at least in any project folders of interest) and cases where I did use a lot of other peoples assets were rare.

These are all compressed using 7zip, you will probably need that to open them.

I am uploading the 2012 folder, I will edit post when done. (It's 5.7GB and I'm on a 100KB/s upload speed, figured I would get the other two out first.)
2012 Folder (5.7GB Compressed Download)
2013 Folder (1.47GB Compressed Download)
2014 Folder (437MB Compressed Download)


10
Released Maps and Mods / SWBF1 Museum
« on: August 07, 2014, 07:28:58 PM »
Everything except below this line was written by Snake.

The SWBF1 Museum is here!!!!

WIP Thread

Good grief.. SO many people help it's hard to name them all.
The main modders involved were myself, SK, Unit 33, Sereja, and RC. A lot of thanks to Sereja and RC, who did a ton of modeling. This took, what, two years(?) to make.. It's definitely been a long road for all of us.
The great thing is I can credit the whole community on this. With all the info on the walls of the Museum, everyone is involved. It is not as complete as I would like but putting so much info on the walls was amazingly difficult and time consuming. Thanks to everyone who contributed. It's a great monument to SWBF1.


What to do in the Museum

There is a lot to do besides look at the Museum. There's paintball, laser tag, a deathmatch arena, Noobs to fight, and cars to race. Not to mention the hidden world underneath. (If you can find the holographic doorway) So I hope you all enjoy the thrills and sadness of the map. Remember all that SWBF has meant to us. There's been rivalries and arguments but in the end we all share a common bond, because of how few of us there are. Hopefully that will carry over to SWBF3. (I may see you guys there!)

DOWNLOAD
DOWNLOAD (MediaFire)

Well.. I guess this is it. I leave for college Saturday morning.. I'll be packing non-stop 'til then. Goodbye guys! God bless. :bye:

12
Released Assets / SleepKiller's Mungeless Light Changer
« on: May 28, 2014, 07:24:26 PM »
Are you sick and tired of people not being able to customize the lighting on your map after you've shipped it? Do you wish you didn't have to remunge just to change the lighting on your map? Do you wish you could just edit a single file and have the lighting be changed when you reload the map? Well now you can! Introducing the- Wait that joke is old.

So for those of you who don't know (most of you) I not too long ago made some nifty scripts for Snake's SWBF Museum, one of which let's you ship your map with the ability to change your world's lighting based off an lua script instead of having to remunge the world or munge your own lighting config file. (The script basically does the latter but dynamically and on demand.)

Installing and Integrating It
It is relatively simple to install and integrate first step you're going to do is download the zip file attached to this post. Once you have that extract the contents anywhere and leave a windows explorer window open at those extracted files.

Step 1.
Open your map's mission.req and add this section to it before the last } it's very important that you put it before the last curly bracket but after the second to last curly bracket. Got it?

Code: [Select]
REQN
{
"script"
"LightFunctions"
}

Step 2.
From the zip folder you downloaded copy LightFunctions.lua and put it into the same folder as your map's scripts. If you don't know what I'm talking about you need to learn to mod a bit more before trying to implement this ;)

Step 3.
Open your map lua scripts and find the line that your world.lvl is loaded on. It looks something like this ReadDataFile("dc:swbf4ever\\swbf4ever.lvl"), only with your map name instead of swbf4ever. Now once you've found that line put these three lines anywhere after it.

Code: Lua
  1. dofile("Addon/YOURMAPIDHERE/lighting.lua"); --This loads the lighting config stored as an lua script.
  2. SetLighting("Addon/YOURMAPIDHERE/Data/_LVL_PC/lighting.config"); --This calls the magical function that does everything.
  3. ReadDataFile("dc:lighting.config"); --This loads up the file made by the magical function.

Replace YOURMAPIDHERE with well, your map ID.

Step 4.
Take the file lighting.lua from the zip and place it in your Addon folder. (The one with addme.script in.)

Step 5.
Munge and you should now be done. Enjoy your new found ability to edit lighting in the map without remunging. Pro Tip: Restarting the map also reloads it.


If you encounter any problems while doing this post your code and detail the steps you took. So I can know where you went wrong or where I went wrong in explaining something.

13
Message me or post here if interested. This is important work. Help would be greatly appreciated.

14
Public Square / [code][/code] tags now support syntax hightlighting
« on: March 02, 2014, 05:35:18 PM »
I thought the title was pretty descriptive. Yesterday I tested it out, assuming no issues arise it'll stay installed. Using it is really simple just change

[code][/code]
to
[code=lua][/code]


Of course lua isn't the only language supported. The developers of the mod say it supports over 200 languages. Here are a couple of examples.

Code from SKFunctions.lua
Code: Lua
  1. --LogProgress
  2. --Creates a log entry, the file path will need editing for your map.
  3. --                                      String Bool
  4. function LogProgress(s,n)
  5.  
  6.         if(newlog == 0) then
  7.                 writeto("addon\\skmc2\\iofiles\\log.txt")
  8.                 write("Starting log. \nMap ID:")
  9.                 write(mapID)
  10.                 write("\n\n")
  11.         --      write(date("%c"))
  12.         --      write("\n")
  13.                 newlog = 1
  14.         end
  15.        
  16.        
  17.         if(s == nil) then --Has anything actually been sent to the funtion?
  18.                 appendto("addon\\skmc2\\iofiles\\log.txt")
  19.                 write("Bad argument sent to LogProgress, requires string or number. Exiting function.")
  20.                 write("\n\n")
  21.                 flush()
  22.         else
  23.                 appendto("addon\\skmc2\\iofiles\\log.txt")
  24.                 write(s)
  25.                
  26.                 if(n >= 1) then
  27.                         write("\n\n")
  28.                 end
  29.                
  30.                 flush()
  31.         end
  32.        
  33. end

Code from schMEe.au3
Code: AutoIt
  1. Func _MSH_get_parent_index($iThisTag)
  2.         For $iParent_index = $iThisTag To 1 Step -1
  3.                 If _MSH_TagIsPossibleChildOfParent($aMSHTagList[$iParent_index], $aMSHTagList[$iThisTag]) Then ExitLoop
  4.         Next
  5.         Return $iParent_index
  6. EndFunc   ;==>_MSH_get_parent_index

15
Star Wars Battlefront / Unity 3D Board
« on: February 17, 2014, 02:35:53 AM »
WHERE DID IT GO SLEEPKILLER? WHAT DID YOU DO SLEEPKILLER? WHY CAN'T I SEE IT SLEEPKILLER?

These are all fine questions in a single sentence...

The board has been privatised, bug Unit 33 about access.

Pages: [1] 2 3 ... 11