Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you port Source Engine maps to the Xbox 360? If so, how? #79

Closed
metalex10 opened this issue Jan 21, 2023 · 17 comments
Closed

Can you port Source Engine maps to the Xbox 360? If so, how? #79

metalex10 opened this issue Jan 21, 2023 · 17 comments
Labels
question Further information is requested slow burn lots of work & will take a long time Source Engine Applies to all Source Engine branch scripts valve.orange_box_x360 The Orange Box (Xbox 360) branch script valve.sdk_2013_x360 Portal 2 (Xbox 360) branch script wontfix This will not be worked on Xbox360 Applies to branches on the Xbox 360

Comments

@metalex10
Copy link

Convert maps of valve maps , little to big endiand, in other words pc to x360, example l4d2 maps PC to x360,
Is there a function like .saveAs for example? or convertTo...

@snake-biscuits
Copy link
Owner

snake-biscuits commented Jan 21, 2023

This might be possible, I would need a way to test map changes on console
Would also probably need to build maps to the x360 engine limits

@snake-biscuits
Copy link
Owner

idk how Vphysics differs between pc and console either, so ported maps might not have physics

@metalex10
Copy link
Author

There may be a method where pc default and console default are compared, because I think it is only the conversion between their own engines between endians

@metalex10
Copy link
Author

is endian wrapper and compress with lzma

@snake-biscuits snake-biscuits added enhancement New feature or request slow burn lots of work & will take a long time valve.orange_box_x360 The Orange Box (Xbox 360) branch script labels Feb 22, 2023
@snake-biscuits snake-biscuits added this to the v0.5.0 milestone Mar 17, 2023
@snake-biscuits snake-biscuits added the valve.sdk_2013_x360 Portal 2 (Xbox 360) branch script label Aug 12, 2023
@snake-biscuits snake-biscuits moved this to Todo: Research in bsp_tool Core Functionality Aug 12, 2023
@snake-biscuits snake-biscuits moved this to Todo: Research in bsp_tool Format Coverage Aug 12, 2023
@metalex10
Copy link
Author

ok, so how convert this maps to x360?

@snake-biscuits
Copy link
Owner

It might be, I would need a way to test map changes on console
Would also probably need to build maps to the x360 engine limits

Testing

Figured out a way to do testing, using Xenia
Turns out Xenia can launch the extracted default.xex, & other modded files
Using Xenia Canary since it patches the game a little

Requires changing the following settings in xenia-canary.config.toml:

# safety net
break_on_unimplemented_instructions = false
# console commands
# "-dvd" helps the game run
# "-game hl2 +map credits" sets the map to Half-Life 2's credits
cl = "-dvd -game hl2 +map credits"
# text rendering
d3d12_readback_memexport = true
d3d12_readback_resolve = true

Using cl="-dvd -game hl2 +map credits" loads directly into the end credits of Half-Life 2
Choosing maps by name makes things easier than I was expecting
Was dreading modding menus / replacing files to launch into maps
Also means testing is extra fast, I can make a shortcut to open OrangeBox/default.xex w/ Xenia

Team Fortress 2 can't run any maps, gives an in-game error saying: "Lost Connection to Game Server"
I don't know if that means the locally hosted server or some master server
May have to get my Xbox360 out and compare the unemulated game at some point

Engine Limits

I've started making a spreadsheet of how close Xbox360 maps get to the engine limits on PC
Right now they look pretty reasonable, I may already have some under the Xbox360 limits
Comparing against the equivalent PC maps is probably a good idea though

The Xbox360 limits I saw might be for the Xbox version of HL2
Or the Xbox360 limits are dynamic in some way

Related Issues

Also, more Xbox360 games I haven't checked support for:
https://github.com/xenia-project/game-compatibility/issues?q=is%3Aopen+label%3Atech-engine-source+sort%3Aupdated-desc

@snake-biscuits snake-biscuits changed the title Is possible and how ? Convert maps of valve maps , little to big endiand, in other words pc to x360 Can you port Source Engine maps to the Xbox 360? If so, how? Oct 19, 2023
@snake-biscuits snake-biscuits added Source Engine Applies to all Source Engine branch scripts Xbox360 Applies to branches on the Xbox 360 labels Oct 19, 2023
@snake-biscuits
Copy link
Owner

I am now comfortable enough with these tools to begin research
Map ports will likely involve cutting out a lot of lumps
This means maps will have limited functionality

Physics would require more reverse engineering than I am prepared for
There's also legal concerns (Havok Licensing)
I may have to copy lumps from existing maps in the meantime

Progress will be heavily reliant on motivation & time constraints
As of right now I am still actively working on mapping tools for the Titanfall Engine
There are also open issues for porting maps to Vindictus & Counter-Strike: Online 2

I am not making this a priority, but I will be a bit more active on this in future

@snake-biscuits snake-biscuits added the extensions.convert related to porting maps between branches label Oct 19, 2023
@snake-biscuits
Copy link
Owner

https://youtube.com/watch?v=Uou1ZjFjCOw
It looks like this modder has already ported some maps
They have a discord link in the video description
Asking there would get you porting maps way faster than waiting for me to build a converter

@snake-biscuits snake-biscuits added question Further information is requested wontfix This will not be worked on and removed extensions.convert related to porting maps between branches enhancement New feature or request labels Oct 20, 2023
@snake-biscuits snake-biscuits moved this from Todo: Research to Done in bsp_tool Core Functionality Oct 20, 2023
@snake-biscuits snake-biscuits moved this from Todo: Research to Done in bsp_tool Format Coverage Oct 20, 2023
@snake-biscuits
Copy link
Owner

I wrote a whole guide on how to do this:

The source code for the necessary tools is all available on GitHub
makegamedata.exe sources are legally questionable, but a 100% legal copy is attainable via Dino D-Day on Steam

Everything you need to port maps to the Xbox360 is out there, on The Internet
You don't even need bsp_tool for any stage of the process
Which is great! I don't want to maintain tools for multiple modding communities

bsp_tool is a small personal project, gathering public information and organising it
First & foremost, bsp_tool is for analysis

Not map compilation
Not map porting
Not developing tools

While bsp_tool could be used as the basis for a larger tool, it is not designed for that task
Python is nowhere near the performance needs of most mapping related projects

Writing bsp_tool in python allows for fast prototyping
Prototypes that can be re-written in faster languages, like C++
Like bsp2gltf, which is also a small personal project
io_import_rbsp runs in Blender Python, and might be the worst performing code I've ever written

Having Official Tools is a rare thing, and Dino D-Day/bin/makegamedata.exe is an Official Tool
It's not perfect
The workflow sucks
But it's better than a python script.

I will not be developing an extension to Source Engine maps to the Xbox 360
So, I've marked this issue as wontfix
This Issue is not directly relevant to bsp_tool or it's development

@metalex10
Copy link
Author

OK you work is fine i next work for my account

but is necesary convert .nav files too or byteswap

for l4d2 maps
for example
c1m1_hotel.nav to c1m1_hotel.360.nav

need the files?

@snake-biscuits
Copy link
Owner

According to the .bat files the Xbox360 Discord provides, makegamedata.exe can convert .nav
AFAIK the one .exe can convert all files needed for a whole game

@snake-biscuits
Copy link
Owner

L4D2 specifically? Left4Dead2 has a unique map map format
Listed in bsp_tool as "valve.left4dead2"

Copying the .dlls from Left 4 Dead 2's SDK might help (see #154 for the list of dlls)
There's more details in the Discord too

@metalex10
Copy link
Author

yes im decompile map hotel and i copy all textures and .pak from l4d2 folder to hl2 folder and compile map with hammer and finally run map form pc for now default but need more test for this

i need to convert .nav files manually too

thanks for all friend

@metalex10
Copy link
Author

image

@metalex10
Copy link
Author

image

just convert textures and models and ready .....

Copy link

I don't know if this is noted, but setting cl in Xenia' settings to "-dvd -game tf +map ctf_2fort -insecure -noip -untrusted -xnet_bypass_security" loaded into 2fort for me. I just tried a bunch of parameters so I don't know if it's just one which worked or if it's in combination but it works.

it works

@snake-biscuits
Copy link
Owner

Good find, I think I saw a patch (https://github.com/Luctaris/game-patches/tree/TOB_TU5_Patches) that sets the same convars
Only noted that in #154 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested slow burn lots of work & will take a long time Source Engine Applies to all Source Engine branch scripts valve.orange_box_x360 The Orange Box (Xbox 360) branch script valve.sdk_2013_x360 Portal 2 (Xbox 360) branch script wontfix This will not be worked on Xbox360 Applies to branches on the Xbox 360
Projects
Status: Done
Status: Done
Development

No branches or pull requests

3 participants