Skip to content

Commit

Permalink
uh I didnt commit these? lol
Browse files Browse the repository at this point in the history
  • Loading branch information
Zedb0T committed Mar 31, 2024
1 parent ab43af4 commit 7b960f4
Show file tree
Hide file tree
Showing 40 changed files with 5,201 additions and 183 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
"xutility": "cpp",
"coroutine": "cpp"
}
}
60 changes: 60 additions & 0 deletions custom_levels/jak1/spyro2-autumnplains/spyro2-autumnplains.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
// The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name)
// the name of this file, and the folder this file is in must have the same name.
"long_name": "spyro2-autumnplains",
// The file name, should be upper case and 8 characters or less.
"iso_name": "SPYROATM",
// The nickname, should be exactly 3 characters
"nickname": "ATM", // 3 char name, all uppercase

// Background mesh file.
// Must have vertex colors. Use the blender cycles renderer, bake, diffuse, uncheck color,
// and bake to vertex colors. For now, only the first vertex color group is used, so make sure you
// only have 1.
"gltf_file": "custom_levels/jak1/spyro2-autumnplains/test-zone2.glb",
"automatic_wall_detection": false,
"automatic_wall_angle": 0.0,
// if your mesh has triangles with incorrect orientation, set this to make all collision mesh triangles double sided
// this makes collision 2x slower and bigger, so only use if really needed
"double_sided_collide": false,
"base_id": 100,

"ambients": [],

"actors" : [
{
"trans": [106.15, 201.96, 94.35], // translation
"etype": "fuel-cell", // actor type
"game_task": 0, // associated game task (for powercells, etc)
"quat" : [0, 0, 0, 1], // quaternion
"bsphere": [-21.6238, 19.3496, 17.1191, 10], // bounding sphere
"lump": {
"name":"test-fuel-cell"
}
},

{
"trans": [-15.2818, 15.2461, 17.1360], // translation
"etype": "crate", // actor type
"game_task": 0, // associated game task (for powercells, etc)
"quat" : [0, 0, 0, 1], // quaternion
"bsphere": [-15.2818, 15.2461, 17.1360, 10], // bounding sphere
"lump": {
"name":"test-crate",
"crate-type":"'steel",
"eco-info": ["int32", 5, 10]
}
},

{
"trans": [-5.4630, 17.4553, 1.6169], // translation
"etype": "eco-yellow", // actor type
"game_task": 0, // associated game task (for powercells, etc)
"quat" : [0, 0, 0, 1], // quaternion
"bsphere": [-5.4630, 17.4553, 1.6169, 10], // bounding sphere
"lump": {
"name":"test-eco"
}
}
]
}
Binary file not shown.
9 changes: 9 additions & 0 deletions custom_levels/jak1/spyro2-autumnplains/testzone.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
;; DGO definition file for Awful Village level
;; We use the convention of having a longer DGO name for levels without precomputed visibility.

;; the actual file name still needs to be 8.3
("ATM.DGO"
("static-screen.o"
"spyro2-autumnplains.go"
)
)
24 changes: 23 additions & 1 deletion decompiler/config/jak1/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -11868,6 +11868,28 @@
(unknown-63 63)
)

(defenum collide-action-old
:type uint32
:bitfield #t
(solid 0)
(ca-1 1) ;; sticky?
(ca-2 2) ;; target?
(ca-3 3) ;; edge grab related? if set, we can't initiate collision.
(ca-4 4)
(ca-5 5) ;; unused?
(ca-6 6) ;; swing pole, manipy
(ca-7 7) ;; camera
(ca-8 8) ;; swingpole
(ca-9 9) ;; eco vents?
(ca-10 10)
(ca-11 11)
(ca-12 12)
(ca-13 13)
(ca-14 14)
(ca-15 15) ;; manipy
(ca-16 16)
)

(defenum collide-action
:type uint32
:bitfield #t
Expand Down Expand Up @@ -13346,7 +13368,7 @@
(:methods
(debug-draw (_type_) none) ;; 9
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float) ;; 10
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol) ;; 11
;; (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol) ;; 11
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float) ;; 12
(fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none) ;; 13
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none) ;; 14
Expand Down
1 change: 1 addition & 0 deletions game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(RUNTIME_SOURCE
external/discord_jak1.cpp
external/discord_jak2.cpp
external/discord.cpp
multiplayer.cpp
graphics/display.cpp
graphics/gfx_test.cpp
graphics/gfx.cpp
Expand Down
60 changes: 60 additions & 0 deletions game/kernel/common/kernel_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,63 @@ struct FileStream {
u32 name; // basic
s32 file; // int32
};

struct HnsPlayerInfo {
u32 role; // mp-game-role enum
u32 mp_state; // mp-tgt-state enum
s32 collected_by_pnum;
s32 rank;
};

const int MAX_USERNAME_LEN = 100;
struct RemotePlayerInfo {
u32 username; // string (basic)
u32 color; // tgt-color enum
s32 is_admin; // 0 or 1 (idk how to write #t/#f from c++ side)
float trans_x;
float trans_y;
float trans_z;
float quat_x;
float quat_y;
float quat_z;
float quat_w;
s32 tgt_state;
HnsPlayerInfo hns_info;
};
// static_assert(sizeof(RemotePlayerInfo) == 32, "RemotePlayerInfo size is wrong");

struct HideAndSeekGameInfoStruct {
// admin-driven settings
u32 target_hider_type;
u32 level_mode;
u32 continue_point_mode;
s32 hiders_move; // 0 or 1 (idk how to write #t/#f from c++ side)
s32 hiders_pause_zoom; // 0 or 1 (idk how to write #t/#f from c++ side)
s32 seekers_infect; // 0 or 1 (idk how to write #t/#f from c++ side)
s32 num_seekers;
s32 last_winner_as_seeker; // 0 or 1 (idk how to write #t/#f from c++ side)
float fog_distance;
float hider_speed;
float seeker_speed;
s32 time_to_start;
s32 time_to_hide;
s32 hider_victory_timeout;
s32 post_game_timeout;
// server-driven fields
s32 alert_found_pnum;
s32 alert_seeker_pnum;
s32 num_hiders;
s32 num_hiders_left;
};

const int MAX_MULTIPLAYER_COUNT = 12;

struct MultiplayerInfo {
s32 game_type_mode;
s32 player_num;
s32 lobby_name;
RemotePlayerInfo players[MAX_MULTIPLAYER_COUNT];
HideAndSeekGameInfoStruct hide_and_seek_game_info;
u32 state; // mp-game-state enum
};
//static_assert(sizeof(MultiplayerInfo) == 116, "MultiplayerInfo size is wrong");
11 changes: 10 additions & 1 deletion game/kernel/common/kmachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <chrono>
#include <SFML/Audio.hpp>
#include <SFML/Audio/Music.hpp>

#include "game/multiplayer.h"

#include "common/global_profiler/GlobalProfiler.h"
#include "common/log/log.h"
Expand Down Expand Up @@ -1167,9 +1167,18 @@ void init_common_pc_port_functions(
// debugging tools
make_func_symbol_func("pc-filter-debug-string?", (void*)pc_filter_debug_string);

// HTTP server stuff
make_func_symbol_func("pc-http-register", (void*)http_register);
make_func_symbol_func("pc-http-update", (void*)http_update);
make_func_symbol_func("pc-http-update-settings", (void*)http_update_settings);
make_func_symbol_func("pc-http-mark-found", (void*)http_mark_found);
make_func_symbol_func("pc-http-get", (void*)http_get);


// init ps2 VM
if (VM::use) {
make_func_symbol_func("vm-ptr", (void*)VM::get_vm_ptr);
VM::vm_init();
}

}
3 changes: 3 additions & 0 deletions game/kernel/jak1/kmachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "common/util/string_util.h"

#include "game/external/discord_jak1.h"
#include "game/multiplayer.h"
#include "game/graphics/display.h"
#include "game/graphics/gfx.h"
#include "game/graphics/sceGraphicsInterface.h"
Expand Down Expand Up @@ -566,6 +567,8 @@ void InitMachine_PCPort() {
auto settings_path = file_util::get_user_settings_dir(g_game_version);
intern_from_c("*pc-settings-folder*")->value = make_string_from_c(settings_path.string().c_str());
intern_from_c("*pc-settings-built-sha*")->value = make_string_from_c(build_revision().c_str());

intern_from_c("*local_username*")->value = make_string_from_c(username);
}

/*!
Expand Down
5 changes: 5 additions & 0 deletions game/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "graphics/gfx_test.h"

#include "third-party/CLI11.hpp"
#include "multiplayer.h"

#ifdef _WIN32
extern "C" {
Expand Down Expand Up @@ -89,6 +90,10 @@ std::string game_arg_documentation() {
int main(int argc, char** argv) {
ArgumentGuard u8_guard(argc, argv);

read_username_from_file(username);
std::cout << "Username: " << username << std::endl;
//set_multiplayer_from_json();

// CLI flags
bool show_version = false;
std::string game_name = "jak1";
Expand Down
Loading

0 comments on commit 7b960f4

Please sign in to comment.