Jump to content

Introducing Sphene, the SCM Interpreter


Megadreams

Recommended Posts

Are you planning on doing the VC / LC portions under the LC / VC engine(s) or in SA? If the secound one I can contribute the maps for both of them; I've got 100% ports of the main worlds (With perfect performance) and I can easily port over the interiors (As well as vehicles and stuff); heck I even have alot of their vehicles updated to SA quality to suit the environment better.

Edited by CodyJ(L)
  • Like 1
Link to comment
  • Discord Moderators

We're indeed planning to do it within SA, the requirement for players to provide the data files themselves (excludes the assets) is a way to make said players also own these games legitimately. It would be amazing if you could indeed help us out with the maps/vehicles, we'd appreciate that a lot!

Link to comment

I'll be working on finishing up the complete versions W/Interiors included then. VC map is modified to add open world interiors so I'm not 100% certain how that would effect it; but if it does I can likely do another version.

Spoiler

Also, regarding the legitimately owning thing; legally this is not really required (As mods such as San Vice, liberty2SA and a few others have no problems)

 

Edited by CodyJ(L)
Link to comment
  • Discord Moderators
10 hours ago, CodyJ(L) said:

I'll be working on finishing up the complete versions W/Interiors included then. VC map is modified to add open world interiors so I'm not 100% certain how that would effect it; but if it does I can likely do another version.

Sounds good, thanks! And that should be fine (hopefully).

Link to comment
  • 1 month later...
  • Discord Moderators

Unfortunately it doesn't, that is still part of the actual game logic in gta_sa.exe which we have to simulate. However some AI logic is actually stored inside main.scm, the cars in the bloodring minigame at the stadium in San Fierro are entirely controlled by it.

Link to comment
  • 2 weeks later...

This is pretty cool. I do wonder if it'd be easier to make a system to transpile/decompile the code from SCM to MTA's LUA? Given that you'll need to modify the missions quite a lot, is SCM actually the best place to do this? I assume there will be opcodes that have to be added to SCM to facilitate co-op. It'd also be much faster to run, presumably.

Link to comment
  • Discord Moderators

We have actually considered this very recently and will test how big the performance gain would be as it would still be a significant amount of extra work to accomplish this. Although your point that this would make developing the Co-Op portion easier is quite valid as we indeed have to introduce some extra instructions ourselves for it to make any sense at all. Originally we were going to make it possible for Sphene to automatically call Lua code when it reaches certain portions in the code. Perhaps this is what we needed to finally consider all of this extra work actually worthwhile.

Edited by Megadreams
Link to comment

@Megadreams I'm interested that you say it's a lot of extra work. Obviously you've already done a lot of work on this - so changing strategy is obviously difficult - and I've not really thought a huge amount about it so maybe it's different to how I expect, but...

The key difference between transpiling and interpreting is that instead of parsing the SCM and then calling functions based on it, you need to generate code that calls the same functions from the SCM. I imagine that either way you end up writing a library of code that handles each operation, and that library could be almost identical between both systems. With the transpiling approach I'd guess that control flow might be the tricky bit - though I believe Lua now supports 'goto' which could help quite a bit (I'm not sure if MTA has updated Lua yet - I know it was being talked about). 

Anyway interesting stuff - keep us updated!

  • Like 1
Link to comment
  • Discord Moderators

Unfortunately MTA still seems to use Lua 5.1 (at least that's what I see in the source) so goto isn't available yet. When transpiling we also lose the ability (especially due to a lack of goto) of being able to modify the script pointer which is an ability we'll need for the Co-Op part of Sphene in the future. But, I have talked to qaisjp about this very recently and he suggested to go the route of JIT to give ourselves the benefit of both. Transpiling when most appliceable (loops for example) while being able to remain the ability of easily moving the script pointer to somewhere else in the script to keep things synced up. Something I agree might be the best solution to this.

Won't disclose quite yet how we plan to do the sync for Co-Op as that is still a work in progress but at this stage it is known that we need to maintain that ability at least.

Link to comment
  • 1 year later...
  • 2 years later...
  • 1 month later...
  • Discord Moderators

Quick update, project is very much alive and loads of progress has been made since this topic was made. I'll add a new comment soon outlining the work we've done over these 6 years. I usually just do updates on our Discord server but realized that there's possibly a group of people out there that might be trying to get their updates on the project here.

Edited by Megadreams
  • Like 1
  • Thanks 1
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...