OSP QoL SNM's Lab

Users who are viewing this thread

SNM's Lab

As part of my long-term development of Fate/, I often take mental breaks by scripting little personal side-projects. Typically I'll spend a week or two trying new gameplay styles or implementing new game mechanics from something I was playing or thinking of at the time. I will start collecting them and sharing them here for the community at large to see if they can find any use for the contents.


pMMO
(pseudo-MMO)
Inspired by Sword Art Online: Hollow Realization

Inspiration: In SAO:HR when in the hub world you see a few dozen other player characters wander around, they can be interacted with and befriended. You will see them in their parties when you go adventuring. When I first realized the players were persistent (there are something like 150 or so in 40-50 Guilds), it felt really cool to see them. After a dozen hours however, you realize they are stagnant, never leveling or getting new gear unless you invite them to your party. I wanted to fix that aspect as well as expand this to include a "real-world" schedule where players have preferred times to be "logged in" and during their logged in time, would prefer questing or hunting or battling based on their personality and goals.

Concept: Create a fake world populated by "players" who go about their own goals, parallel to your own objectives.

Did I succeed?: Not as much as I would have liked to, but, I still really like this idea. I may expand upon it later.

If I were to expand it more: I would add tasks and decision making based on needs/wants/preferences, add the real-time clock and player schedules, make players stick together as a party in adventure mode, give NPC Vendors their chat/sell functions, etc, etc.

How to Play: Create a Character, open the Camp Menu, Choose Lumbridge (Hub Town Test, this got gutted and they just walk back and forth through a choke point, it had been a large city with them running between POIs) or Adventure (Field Test).

Why it might be interesting: I made heavy use of Python scripts to automate the generation of 1000 unique players, a few NPCs and a handful of mobs. Outside of that, gameplay is mostly unaltered, with the AI players wandering around using a Point of Interest system, choosing a random POI and wandering there. Mob AI becomes aggressive to characters that wander too closely to their patrol zones, and if struck, call over allies to assist them. PVP combat exists, and parties will all attack if you strike one of their own.

Link to Source with included build. (Google Drive)
Source Only (Bitbucket)



SWC: Obi-Wan
Inspired by Obi-Wan (Xbox. 2001)
Requires WSE2


Inspiration: Obi Wan was an Xbox exclusive that I literally played for ten minutes as a child. It randomly came up on my YouTube feed and since the Xbox is still difficult to emulate, I couldn't get it out of my system. It seemed like a lot of unachieved potential, so I wanted to see what could happen if I took a swing.

Concept: Create a character action game in the Warband engine that utilizes the skill-based melee combat, but expands the players offensive options to match those in Obi-Wan.

Did I succeed?: Yes, actually. Outside of ledge climbing (Roughed, needs lots of work), acrobatics, and force push (objects), I got the gameplay down.

If I were to expand it more: Finish the ledge climb, add the force enhanced attacks, add objects to use the object force push on, and add both the Tutorial and Coruscant levels.

How to Play: Create a Character, open the Camp Menu, Choose "Go to Coruscant". E and R cycle through force powers, middle mouse activates. Holding left Ctrl enhances most force powers as well as character speed and jump height. Pressing K spawns droids in random locations within 10m of player. Jumping towards a wall will check if you're within range of its ledge, if you are, you will snap to the ledge and can move left and right, you actually can go through the wall/ledge very easily. Pressing Forward (clamber up), Backwards (drop down), or Jump will end the ledge grab.
PowerEffectEnhanced Effect (Left-Ctrl Held)
Force Push (Enemy)Throw nearest enemy short distance and knock downNow affects all enemies within 5m in front of player
Force Push (Object)NoneNone
Force PullPull nearest enemy's blaster from their handsNone
Lightsaber ThrowThrow Lightsaber 5mNow Lightsaber can fly indefinitely (Still needs to fly 5m forward. Click MMB to end flight instantly at any point)
Force FocusSlow timeNone
Block (Blasterbolt)Reflect blaster fire in random directionReflect blaster fire back at shooter

Why it might be interesting: Force Powers! The Lightsaber Throw is particularly cool in its implementation. The rest are fairly reliant on WSE2, but could be ported to the original engine without much work. I suppose the busted ass ledge climb could be interesting, though, it is both more difficult and less useful than a wall-climb.

Link to Source with included build. (Google Drive)


All code included in the above projects are now to be considered Open-Source, and provided as-is. Art assets are on a per-mod basis and should not be used.
 
Last edited:
I didn't intend to open your SWC Mod source code today, and saw that there is an ow_force_jump part, which has an operator "agent_accelerate", I want non-player agents to jump, it is not difficult to implement. But I want to add a horizontal acceleration to it, like jumping backwards, but the direction is not always correct. Can you assist me with this? Here is the code for the test player:
Code:
    (0, 0, 1, [(ge, "$cheat_mode", 1),(key_is_down, key_f10)],
    [
        (set_fixed_point_multiplier, 1000),
        (get_player_agent_no, ":player_agent"),
       
        (agent_get_position, pos12, ":player_agent"),
        (position_get_rotation_around_z, ":angle", pos12),
        (convert_to_fixed_point, ":angle"),
        (store_sin, ":sin_angle", ":angle"),
        (store_cos, ":cos_angle", ":angle"),          
        (store_mul, ":x", -10, ":sin_angle"),
        (store_mul, ":y", -10, ":cos_angle"),
        (init_position, pos58),
        (position_set_x, pos58, ":x"),
        (position_set_y, pos58, ":y"),
        (position_set_z, pos58, 10000),
        (agent_accelerate, ":player_agent", pos58, 0),
        (agent_cancel_current_animation, ":player_agent", 1),
        (agent_cancel_current_animation, ":player_agent", 0),
        (agent_set_animation, ":player_agent", "anim_jump"),
    ]),
 
I didn't intend to open your SWC Mod source code today, and saw that there is an ow_force_jump part, which has an operator "agent_accelerate", I want non-player agents to jump, it is not difficult to implement. But I want to add a horizontal acceleration to it, like jumping backwards, but the direction is not always correct. Can you assist me with this? Here is the code for the test player:
Code:
    (0, 0, 1, [(ge, "$cheat_mode", 1),(key_is_down, key_f10)],
    [
        (set_fixed_point_multiplier, 1000),
        (get_player_agent_no, ":player_agent"),
    
        (agent_get_position, pos12, ":player_agent"),
        (position_get_rotation_around_z, ":angle", pos12),
        (convert_to_fixed_point, ":angle"),
        (store_sin, ":sin_angle", ":angle"),
        (store_cos, ":cos_angle", ":angle"),       
        (store_mul, ":x", -10, ":sin_angle"),
        (store_mul, ":y", -10, ":cos_angle"),
        (init_position, pos58),
        (position_set_x, pos58, ":x"),
        (position_set_y, pos58, ":y"),
        (position_set_z, pos58, 10000),
        (agent_accelerate, ":player_agent", pos58, 0),
        (agent_cancel_current_animation, ":player_agent", 1),
        (agent_cancel_current_animation, ":player_agent", 0),
        (agent_set_animation, ":player_agent", "anim_jump"),
    ]),
I'm sure you saw it in the force jump code, but I also tried and failed. In fact, I've tried this a few times and thought I was just too inexperienced with vectors and stopped. Your attempt being same/similar to mine made me question why it was failing until I saw this comment in the header_operations Note the angle is calculated counter-clockwise, i.e. (1,1) will return 45, not -45. TW math has them determine the angle COUNTERCLOCKWISE instead of clockwise like you and I were expecting. I added this line before running the sin/cos and it worked perfect (store_sub, ":angle", 360000, ":angle"),
 
Last edited:
I'm sure you saw in the force jump code, but I also tried and failed. In fact, I've tried this a few times and thought I was just too inexperienced with vectors and stopped. Your attempt being same/similar to mine made me question why it was failing until I saw this comment in the header_operations Note the angle is calculated counter-clockwise, i.e. (1,1) will return 45, not -45. TW math has them determine the angle COUNTERCLOCKWISE instead of clockwise like you and I were expecting. I added this line before running the sin/cos and it worked perfect (store_sub, ":angle", 360000, ":angle"),
Just tested it, it's perfect! I'm excited to make the AI jump like the player. Thank you so much!:grin:
 
In order to express my gratitude, @SupaNinjaMan,
I provide the code of the player's double jump, which works well.:smile:

Code:
    (0, 0, 0, [],
        [
        (get_player_agent_no, ":player_agent"),
        (ge, ":player_agent", 0),
        (agent_is_alive, ":player_agent"),  
        (agent_slot_ge, ":player_agent", slot_agent_twice_jump, 1),
        (agent_get_animation, ":anim", ":player_agent", 0),
        (agent_get_horse, reg0, ":player_agent"),
        (try_begin),
            (gt, reg0, -1),
            (agent_get_animation, ":anim_horse", reg0),
            (neq, ":anim_horse", "anim_horse_jump"),
            (neq, ":anim_horse", "anim_horse_jump_end"),
            (neq, ":anim", "anim_ride_jump"),
            (neq, ":anim", "anim_ride_jump_end"),
            (agent_set_slot, ":player_agent", slot_agent_twice_jump, 0),
        (else_try),
            (eq, reg0 ,-1),
            (neq, ":anim", "anim_jump"),
            (neq, ":anim", "anim_jump_roll"),
            (neq, ":anim", "anim_jump_loop"),
            (neq, ":anim", "anim_jump_loop1"),
            (agent_set_slot, ":player_agent", slot_agent_twice_jump, 0),
        (try_end),
    ]),
    
    (0, 0, 0.3, 
    [
     (game_key_clicked, gk_jump),
     ],
     [    
        (set_fixed_point_multiplier, 100),
        (get_player_agent_no, ":player_agent"),
        (ge, ":player_agent", 0),
        (agent_is_alive, ":player_agent"),
        (agent_get_slot, ":jump_times", ":player_agent", slot_agent_twice_jump),
        (le, ":jump_times", 1),# To limit jump times
        (agent_get_position, pos9, ":player_agent"),
        (position_get_rotation_around_z, ":angle", pos9),    
        (convert_to_fixed_point, ":angle"),
        #Note the angle is calculated counter-clockwise, i.e. (1,1) will return 45, not -45.
        (store_sub, ":angle", 36000, ":angle"),
        (store_sin, ":sin_angle", ":angle"),
        (store_cos, ":cos_angle", ":angle"), 
        (assign, ":x", 0),
        (assign, ":y", 0),
        (assign, ":z", 12000),#You can change the size according to your preference
        
        (try_begin),
            (game_key_is_down, gk_move_forward),
            (val_add, ":y", 1),
        (else_try),
            (game_key_is_down, gk_move_backward),
            (val_sub, ":y", 1),
        (try_end),
        
        (try_begin),
            (game_key_is_down, gk_move_left),
            (val_sub, ":x", 1),
        (else_try),
            (game_key_is_down, gk_move_right),
            (val_add, ":x", 1),
        (try_end),    

        (agent_get_speed, pos11, ":player_agent"),
        (position_get_x, ":speed_x", pos11),
        (position_get_y, ":speed_y", pos11),
        (convert_from_fixed_point, ":speed_x"),
        (convert_from_fixed_point, ":speed_y"),
        (val_add, ":speed_x", ":x"),
        (val_add, ":speed_y", ":y"),
              
        (store_mul, ":x_vector", ":speed_y", ":sin_angle"),
        (store_mul, ":y_vector", ":speed_y", ":cos_angle"),
        (store_mul, ":x_vector_h", ":speed_x", ":cos_angle"),
        (store_mul, ":y_vector_h", ":speed_x", ":sin_angle"),
        
        (val_add, ":x_vector", ":x_vector_h"),
        (val_sub, ":y_vector", ":y_vector_h"),
        
        #Cut down the speed to look less weird: About *(sqrt2)/2 
        (val_mul, ":x_vector", 70),
        (val_div, ":x_vector", 100),
        (val_mul, ":y_vector", 70),
        (val_div, ":y_vector", 100),
        
        (init_position, pos10),
        (position_set_x, pos10, ":x_vector"),
        (position_set_y, pos10, ":y_vector"),
        (position_set_z, pos10, ":z"),

        (agent_get_horse, reg0, ":player_agent"),
        (try_begin),
            (gt, reg0, -1),
            (agent_accelerate, reg0, pos10, 0),
            (agent_set_animation, ":player_agent", "anim_ride_jump"),
            (agent_set_animation, reg0, "anim_horse_jump"),
        (else_try),
            (agent_accelerate, ":player_agent", pos10, 0),
            (try_begin),
                (eq, ":jump_times", 1),
                (eq, ":speed_x", 0),
                (ge, ":speed_y", 0),
                (agent_set_animation, ":player_agent", "anim_jump_roll"),
            (else_try),
                (agent_set_animation, ":player_agent", "anim_jump"),
            (try_end),
        (try_end),        
        (val_add, ":jump_times", 1),
        (agent_set_slot, ":player_agent", slot_agent_twice_jump, ":jump_times"),
    ]),
 
Last edited:
Back
Top Bottom