Page 1 of 2
HEX EDITING: Adding more AI to the stock levels.
Posted: Sat Sep 23, 2006 10:06 pm
by Broadus
I'm modifying the PSP game, and I want to add more AI (AI per team) into the game by any means necessary.
EVEN MURDER.
I want to do this because the PSP limits the game to 10 AI per team on single player and 6 AI per team on multiplayer, which are ridiculously low amounts as the PSP could easily handle more. 16 AI per team at least, but I'd like to try 32 first to see how fast/slow it goes.
Please don't go off-subject and start asking about how I'm modifying the PSP game in this topic. Just take a gander at this link if you're interested:
http://www.gametoast.com/index.php?name ... pic&t=7031
The PSP is incompatible with anything from the PC, so I have to do everything via hex editing. I've tried out a lot of stuff with repeated failures (though I got Episode 2 clones in, which is always awesome), so now all I plan on doing is adding more AI per team, whether I'm able to add AI for specific levels or a global amount for every level.
TAKE NOTE THAT THE PSP .LVLS ARE ALMOST EXACTLY LIKE THE PC .LVLS! If something works for the PC in hex editing to raise the AI per team, please tell me, because it's almost gauranteed it will also work for the PSP!
http://rapidshare.de/files/33864730/_lvl_psp.zip.html Here are the mission.lvl and shell.lvl files from the PSP. As you can see, they're just like the PC. Mostly.
I've tried modifying both "SetUnitCount" and "units" in the mission.lvl.
"SetUnitCount" will crash the game in the loading screen of a level.
"units" will make some levels crash on the loading screen, and make other levels take forever to load. When those levels finally do load, there's no difference in the amount of AI.
The very second I figure out how to add more AI per team (or someone so kindly tells me how), I will release my modified files with clear instructions on how to use them so other PSP owners can enjoy their copy of Star Wars Battlefront 2 even more.
THE ULTIMATE QUESTION
How do I add more AI (per team) to a level, or raise the global limit from 10 to something like 16 or 32, via hex editing?
RE: HEX EDITING: Adding more AI to the stock levels.
Posted: Sun Sep 24, 2006 10:30 pm
by Broadus
Aw, come on, guys. I'm beggin' ya'! I'm beggin', here!
Just throw some ideas at me! Just suggest something you think MIGHT work, or sounds like it maybe could work in some other land far away from our own!
I'm so tired of playing in colossal XL battles on the PC, then having to do tiny 10 versus 10 battles on the PSP! It's supposed to be a friggin' battle, not an intellectual debate followed by a feast of cupcakes! Nay, followed by a feast of CORPSES!
Not that I think the PSP could handle XL, but you get my point. Too small, is what I'm saying. Drives me insane with the tiny battles.
RE: HEX EDITING: Adding more AI to the stock levels.
Posted: Sun Sep 24, 2006 10:37 pm
by Teancum
Dude......it's been less than a half hour. Chill
Why not munge a project for PC with the number of AI you want, then litereally look in PCs mission.lvl to find SetUnitCount then copy the data after it to your PSP mission.lvl
RE: HEX EDITING: Adding more AI to the stock levels.
Posted: Mon Sep 25, 2006 1:31 am
by Broadus
It was a day and twenty-four minutes.
I don't know how to munge a mission.lvl, but I know that if I did, it would screw everything up. When I take the present mission.lvl from the PC and put it onto the PSP, nothing changes except the models in the game get stretchy and weird and no sounds work.
Though I would like to munge a mission.lvl for the PC. But that's not the point. Point is, stuff can't be taken from the PC and put onto the PSP.
RE: HEX EDITING: Adding more AI to the stock levels.
Posted: Mon Sep 25, 2006 1:46 am
by Zaborack
lol
Teancum who's the one who should be chillin' here?

JK
it's awsome that you are modifiying BFII for the PSP
Broadus, i can't help you out but i hope someone will.
-zaborack
RE: HEX EDITING: Adding more AI to the stock levels.
Posted: Mon Sep 25, 2006 2:16 am
by Broadus
I hope so, too. Playing with 10 AI per team is really sucking, and there's no way to enjoy multiplayer with 6 AI per team.
Posted: Mon Sep 25, 2006 2:40 am
by Adreniline
What Teancum was saying was not to replace the mission.lvl with the Pc's, but rather, hex edit to find the info in the PC's mission.lvl, and to replace the same info in the PSP mission.lvl
Posted: Mon Sep 25, 2006 3:30 am
by Broadus
Oh! Now I see what he was saying. That makes a lot of sense. Zerted suggested it before, but I was pretty confused when he said it, too. Thanks for suggesting that, Teancum, and thanks for esplainin' to me what he said (that I misread), Adreniline.
Still, I don't know how to munge a mission.lvl and I want 32 AI per team. Doesn't the mission.lvl for the PC already specify 32 AI per team, so I shouldn't have to munge anyway? I've looked, and the SetUnitCount doesn't seem to be different... Well, tomorrow, I'll try the whole SetUnitCount thing one more time. I'll try friggin' anything.
Are you guys sure changing the SetUnitCount for a level to something higher than 10 will work, though? I mean, I'm still going to try it again. Just wanting to know what you guys know about it.
Posted: Mon Sep 25, 2006 4:55 pm
by Broadus
Aw, man. I'm disappointed to announce my disappointing discoveries of the meaning of the word disappointment.
SetUnitCount only seems to apply to special units like wookies on Kashyyyk, ewoks on Endor and jawas in Mos Eisley. Basically, if I changed SetUnitCount via hex, I would only be changing the amount of AI-only characters in levels, rather than player-like AI. Some levels don't have SetUnitCount at all, because they don't have the AI-only characters.
So, SetUnitCount does nothing for the AI per team when hex editing.
Now I'm just confused. For obvious reasons, SetUnitCount won't work, but neither will units, which seems to be the only other reasonable factor for level-specific AI-per-team changing.
Surely there's a global thing somewhere that will let me change the AI per team!
This is driving me insane!
Posted: Mon Sep 25, 2006 6:31 pm
by Teancum
Hmm....see if you can find a value called SetupTeams in hex. If you can find that, take a look at any lua posted here. SetUnitCount was only used inside a mission lua for non-playable teams. For the main two teams, a script was used called setup_teams to expidite the process.
Posted: Mon Sep 25, 2006 10:40 pm
by Broadus
Well, SetupTeams contains units, classes and reinforcements. I can change reinforcements all I'd like, changing the units does absolutely nothing, and the numbers next to the classes don't seem to do anything, either.
I don't know. I have to find the thing that determines how high/low the global amount can be set, but I don't know if that can be edited, whether it be with ModTools or hex.
Posted: Mon Sep 25, 2006 10:51 pm
by Teancum
It's very possible that the PSP has a cap set. The PC does. Without enabling UberMode in the lua (something that can't really be hex edited) I think the max is 64 in-play, but with UberMode enabled on PC, up to 200 can be in play.
Posted: Tue Sep 26, 2006 12:29 am
by Broadus
Well, yeah, I can't hex edit uber mode in.
How can you tell what the cap is? I hope and pray it's not twenty on the PSP... Though that would certainly explain a lot.
There has to be some way to raise the cap, or raise the global amount, or something.
I mean, surely there's a secret difference in multiplayer/single player I could try to spot. Single player allows for 10 AI per team, but multiplayer only allows for 6 AI per team. I don't know. Maybe I'm crazy and I'll never figure it out, but it's gotta' be hidden in the hex somewhere...
Posted: Tue Sep 26, 2006 12:31 am
by [RDH]Zerted
For the PC, ScriptCB_SetNumBots( [number or bots per team] ) is the function that sets the max AI per team per map. Its is contained inside the Objective.lua script.
Posted: Tue Sep 26, 2006 12:52 am
by Broadus
Well, I couldn't find anything like that in Objective.lua, but I found it in mission.lvl. The PSP ALSO has the ScriptCB_SetNumBots thing. Would you believe the variables are exactly the same as the PC?
Posted: Tue Sep 26, 2006 2:17 am
by [RDH]Zerted
Yes.
Posted: Tue Sep 26, 2006 2:30 am
by Adreniline
If you can't seem to find out how to edit this, why not try contacting psych0fred?
Since he was helping with development, he may know some of the walls you are coming up against, maybe not, but I have a feeling he just might...
Posted: Tue Sep 26, 2006 4:11 am
by Broadus
Oh, so... Is psych0fred here? On this forum? A dude that helped develop SWBF2?
Posted: Tue Sep 26, 2006 4:44 am
by Linus
That's right, Broadus...
- Linus
Posted: Tue Sep 26, 2006 7:41 am
by Teancum
Adreniline wrote:If you can't seem to find out how to edit this, why not try contacting psych0fred?
Since he was helping with development, he may know some of the walls you are coming up against, maybe not, but I have a feeling he just might...
He told me the PSP version was pretty much outsourced in that only one guy on the team worked on the porting of it.