Jump to content

Welcome to JKHub

This community is dedicated to the games Star Wars: Jedi Outcast (2002) and Jedi Academy (2003). We host over 3,000 mods created by passionate fans around the world, and thousands of threads of people showcasing their works in progress and asking for assistance. From mods to art to troubleshooting help, we probably have it. If we don't, request or contribute!

Get started

Summer Mod Contest Winner

The votes came in and the winner is SephFF and mjt's Costa del Sol! Take a trip to this sunny vacation spot and enjoy the rays and waves. Join Kyle for a drink, venture into the sky for some flying or dive deep for some scuba diving with the local aquatic life!

Read more

The Mandalorian mod contest results

Our Mandalorian-themed mod contest had a good turnout with great submissions. The winner is Doughnuts' Din Djarin playermodel!

Amazing job to all involved!

Read more

Mini-Tutorial: How to increase the NPC limits in Singleplayer. No prior knowledge necessary.


eezstreet

I had a very curious person send me an email asking how to increase the NPC limits in SP, so I went a bit ham and wrote a full guide. This gets asked a lot, so I figured I'd pitch it here. If staff would like (@@Caelum / @@Circa ?) I can post it in the tutorials section if it isn't already there.

 

---

 

Hi,

 

For starters, you will probably want to use the Visual Studio C++ compiler, not Visual Basic as that's a different language altogether.

After you've got that fixed, you'll want to consult this guide for getting the thing compiled: https://github.com/JACoders/OpenJK/wiki/Compilation-guide

Once you get it compiled, you'll note that it builds a "jagamex86.dll", an "Openjk.x86.exe" and a "rdsp-vanilla.x86.dll" (or something along those lines, I don't remember the exact names). You'll want to place the jagamex86.dll in a mod folder (you can create a mod folder in Gamedata), and the other files in your Gamedata folder. Then to launch your mod, you'll want to create a .bat script file (it's very easy, all you need to do is open up Notepad, and save a file as .bat), with the following contents:

`openjk.x86.exe +set fs_game "MyMod"`

Where MyMod is the name of your mod folder. But don't include the `s!

 

If you got that all working, you can start making your edits now.
There are a few specific things regarding limits.
First of all, the list of NPC files is limited to 2048 characters. Look at this file, at this line I've highlighted, and change the number from 2048 to something higher: https://github.com/JACoders/OpenJK/blob/712627afab20aaa772d062a8fc8aeb5d3efa6152/code/game/NPC_stats.cpp#L4084


Second...the .npc files are all dumped into a giant buffer and read from this buffer. This is limited, and if you go over it, you'll likely run into a "NPC_LoadParms: ran out of space before reading ..." error. This limit is handled here: https://github.com/JACoders/OpenJK/blob/712627afab20aaa772d062a8fc8aeb5d3efa6152/code/game/NPC_stats.cpp#L217

 

Just note that this is a hexadecimal number. If you fire up good ol' Windows calculator in Programmer mode, you can see that 0x80000 is the same as 524,288 - so the maximum size of all NPC files combined is 524,288 bytes, or 512 kilobytes. To up this limit, you can just add a couple of zeroes to this (so make it 0x8000000 or something), or use a number larger than 524288. Beware though, the highest you can go is about 2000000000 (2 billion) before you will run into issues (and you don't really want to do this anyway - you'll make the game chew up 1gb in RAM !!)

 

If you have any questions or concerns, feel free to send me a response.
 

---
 


User Feedback

Recommended Comments

Topic moved to Tutorials > Coding.
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

×
×
  • Create New...