Other options?

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Hey!

I can't believe I'm still in love with this game(haven't played in forever though).
This will always be a fond memory from when I was younger.


Did you guys ever consider changing over to Unity?

I don't know anything about Sourcemodding but I'm starting to get familiar with Unity and C#,
and reading over the forums I can see a couple of advantages over using the Source engine.

Pros:
#1 Standalone
#2 Easy as fuck to code for UnityEngine, like mindblowingly simple
#3 AI is simpler to make, animations easier to set up and they blend incredibly well(including dynamic feet placement etc)
#4 Using Unity and Dropbox/BitSync would make a shared build incredibly easy to utilize.
#5 You only build on TOP of the Unity Engine(which is starting to get stupidly strong and limitless in terms of options/alternatives), instead of also having to work through/edit the base files.

Cons:
#1 Primarily map making. Hammer Editor is an incredibly simple and useful tool for making maps, the equivalent of which you will not find in Unity.
#2 Restarting the progress that has already been made.
Feel free to mention other cons! I am curious and eager to learn


Just a fantasy of mine to see this game complete or at least playable. If I had the time to surmount the overwhelming task of getting familiar with the Source engine code, I'd be happy to offer my assistance(but I work 06:00 to 18:00+ and the last hours of the day I spend working out). Perhaps after the army.

I have a habit of suddenly becoming obsessed with this game a short period every year, and start coding for a clone.
Back home I think I've got a full exp system with GUI and complete support for adding new skills/stats/vitals by only adding a simple line in my Character class, physics based combat instead of raycasting like the good ol'e mod, simple mob AI(personality based, randomized floats between 0 and 1 which decide the threshold for aggro range, patrolling, fleeing), and with implemented multiplayer. This also includes a nice menu, character selection and server finder.

In total I think it took me 24 hours of coding(with 12 hours being figuring out how to make my main menu dynamic and getting the god damn save file manager to work).

Being an amateur myself I could only imagine what more skilled coders like you guys could do in the same amount of time! :oops:


Anyways this turned into sort of a diary entry, so back to the point:

Did you guys ever consider other options than the Source engine?
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Progress from boredom

Well, I'm having a break from working out this weekend so I coded some 12+ hours this Friday and yesterday.

I still smile every time I think back to one of the other threads where you sparked my interest for coding, Thothie.
I like to think I've come far since then! :p



This Friday and yesterday:

Inventory
Made an inventory overlay system with drag & drop, right click equip / equip swap / unequip.
Complete with item icon support, and item quality color support(I know I know, it's a trope I just love.
At least I gave the different qualities somewhat original names. Regular, Irregular, Scarce, Unique and Fabled)
I know this doesn't fit completely with the soul of MS but I was just enjoying flexing my coding muscles again.
Made hover-over tooltip which displays full information about the weapon (which you can input/change in the item editor)



Item Editor
Figured what the heck I'll write up an item editor system from scratch again,
wrote it as generic and adaptable as I could so I adding modules to it is effortless.
Added easy way to add particle systems (swing trails, sparkling, spell effects) to weapons.


Combat
Made physics based combat again(instead of raycasting, I never can decide which one I prefer),
complete with stat scaling damage support on a per weapon basis(based on input in the item editor system).
Also made a blood emission system spawn at exact impact location of the sword.


Equipment
Equipping weapons in the inventory anchors it to either an underhand back weapon slot, over the shoulder weapon slot,
or hip weapon slot depending on which flags you gave the weapon in the item editor system.

Animation
Made idle unarmed animations, idle armed animations, equip/unequip underhand, over shoulder and hip animations,
a couple of simple attack animations depending on attack animation flags you give the weapon in the item editor system.


Gonna go work out before dinner, perhaps I'll code some more later this evening.


next on TODO list:
Item pickup from world(probs 5 min tops, including debugging);
Make your character show in real time in the character part of the inventory screen(another 5 min);
Get started on enemy AI again(simple AI: perhaps 30 minutes, better ai: a gooooood couple of hours);
Set up EXP from combat**(maybe 20 minutes);


I'd love if you would point out some key features I haven't mentioned, I love working out implementations(apart from spells, I don't have a mouse and no way to get one here at base so I'm shying away from any designing for now).


I'll probably just use this thread as a diary for when I'm bored.



**(not sure if I want exp granted instantly according to exp granted = (damage / maxhp) * expworth, or set up a table that stores damage per player and distributes when the enemy dies according to the same formula above)
 

Vomika7

New Adventurer
MSS Developer
MSC Developer
Joined
Oct 15, 2010
Messages
112
Reaction score
0
and this is all coded for source?
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Naa, this is for Unity, in C#.

I don't have the spare time to get into the Source engine I think,
considering it doesn't have the vast and extensive documentation that Unity does.

I just enjoy the fact that coding in Unity, you don't code in/around the engine, you code on top of it.

You got experience with coding for Source?
 

TheOysterHippopotami

Active Adventurer
MSS Developer
DarkTide
Joined
Sep 6, 2009
Messages
1,213
Reaction score
42
Age
35
I honestly think, at this point, it'd be worth considering moving to Unreal.
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Don't judge me for the ugly placeholder materials I'm using,
the icons were made in paint using screens of the weapon models
with a laptop mouse haha.

Item editor overview:
https://gyazo.com/647a43b22a8cd1c0ee7b15072b051419
https://gyazo.com/4f3ebf1e1a285448308a1305d848a595
https://gyazo.com/7a8a4690207775caaf890770d6e58a5c -- modularized, easy to just write up a new method and stick it in there

I'm gonna fix up the layout of it but atm I cba as how the item editor looks is of no importance(the code for it won't be compiled into builds). It takes different inputs depending on whether or not you check armor, weapon, useable, consumeable etc. I think a total of 2000 lines went into it, starting from 6000+ and writing it down to a more and more generic code with better grouping. It generates a simple item class and stores it in a database which can be accessed from any script/code, among other things. Still needs a lot of functionality for it to be the multi-tool it needs to be to generate ALL the items of a master sword game, but since I wrote it down as much as I ended up doing, adding modules/additional input is incredibly simple.


Tooltip structuring:
https://gyazo.com/74cf6ffb3f24fcbf6ce125a84a46958a
https://gyazo.com/df26bcf32ee9181f38e072a407eeb71d

Very easy to change layout/setup of it, change font, etc.


Inventory swap functionality:
https://gyazo.com/7732425ce6266383d74c6fe31dea77bb -- This one has a loooot of checks, ifs and for loops to say the least.


Right click equip functionality(this checks for requirements, equipmentslot, autoswaps for other item in equipment slot),
you also see some cancer animation right there lol:
https://gyazo.com/201aaa7fbec9f4f86e5f0c020745340d -- ignore the particles, I was playing around with velocity inheritance to make weapon swing trails etc
https://gyazo.com/1989cc50bf2b91eaca7a42b1623a12cb


Impact detection, passes impact information like impact velocity, impact position, angle of impact etc (can be used for alot), also glimpsing a bit of combo animations(i did it for fun, this is a test_model scene, my main scene is just a yellow bob figure I made out of capsules haha)
https://gyazo.com/740ce72e394859cfc49e02a1965573ec


How to make a player model for fps with a mousepad;
capsule as body, sphere as head, black box stuck halfway in head as sunglasses,
many boxes structured together with empty objects as pivot bones(they can bend and grasp)
https://gyazo.com/72e461c055468161c70b4244cbbd834c

Anyways, I am gonna be gone most of week, in the army so going on winter deployment close to the russian border in -30C, so don't expect further replies in a while at least
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
This might be more for BoX, or whoever is currently working on MS:U, but I was having a pregnant thought, in terms of netcode... Namely, a way to do away with servers, for the most part, and make the game operate more like your typical MMO.

Basically, I was thinking you could rig up the central server to act as a global chat hub and master server, through which other players could connect to one another. The scoreboard would consist of a list of all the players connected to the central server, their relative ping to you, and whether you could reach the required ports on their systems. When hitting a transition, the game asks the player if he wants to form a party. Upon activating the transition with a party, the party leader then hosts a listenserver with the destination map, and all his fellow party members connect to him.

Should a host turn out not to be as good as predicted, the party leader can pass leadership to another party member, and the map will reset, with that person as the new host.

Similarly, clicking on a player's name on the scoreboard or chat, and clicking "travel to player", will connect to that player's server. He (or his host) will get a confirmation on their end, and you'll enter the world already in progress. (Obviously with an option to block you, should you get obnoxious about it.)

In this fashion, one could let client's handle the hard work of actual server hosting, and not have to rely on expensive hosting services, or saints like RKS.

It's true, people very distant from one another might have issues with lag, but this is more or less the case regardless. Game sizes would likely have to be fairly small, but this is probably going to be the case anyways, and you'd at least have the added function that all the players everywhere could chat with one another, regardless of what server they were on (maybe with global/zone chat functions reflecting central server/local listen server).

Despite having a network of listenservers, you could still retain some cheat prevention, via character authentication through the central server (allowing of removal of characters from the network), coupled with mayhaps a /report function.

I suppose, if you really wanted to, you could also add a central hub server running an actual map, such as Edana, where everyone connects to by default, to simplify and encourage party formations.

Granted, it requires a coder with some actual netcode knowledge outside of a shake-and-bake engine, but it solves a lot of issues that come up with a game like this.
 

Vomika7

New Adventurer
MSS Developer
MSC Developer
Joined
Oct 15, 2010
Messages
112
Reaction score
0
Vindictus has something similar to a hub levels with connecting "instances" by boat which seemed conceptually successful, it wouldnt directly apply to mastersword but it was made on the source engine.

https://www.youtube.com/watch?v=o3PQnedHRoo
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
I haven't done any netcoding before, but I've got the weekend to read some documentation and manuals so
I'll see if I can wrap my mind around it.
 

Vomika7

New Adventurer
MSS Developer
MSC Developer
Joined
Oct 15, 2010
Messages
112
Reaction score
0
Well this is all really impressive have you toyed around with source at all?
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Yeah, but that was before I actually knew anything at all about programming.
I am currently on a 5 year old laptop with only an integrated intel graphics card,
so I get horrid fps so I'm not really sure I could even run source haha.

It's just at this point I'm not really sure how using source is better than other engines,
when stuff like Unity offer the same options in simpler to utilize forms.


Anyways, for progress I had some spare time yesterday.


Inventory
Added storage(bank) functionality.
Accessed at selected chests like good ol'e msc.
Added gold ui.
Made it possible to transfer gold to the bank.
Setup burden to impact movespeed.
Added item pickup(raycast).

Combat
Setup exp from combat(ended up making a damagetable on a per player per weapon and doling out exp when enemy dies).

Decided what kind of setup I wanted for my characteristics. https://gyazo.com/50c5238ff39e5c2f3a5bc13e9f79f78a
Weapon skills are separate from the system, and are only used to allow equipping of weapons.
Subskills(brute force, toughness, technique, endurance, finesse) are what decides stat levels.
Vitals(health stamina mana) are then decided by a balance of stats.
I set up exp so that your weapon skill is awarded a full copy of the raw damage exp you did(from the damage table of course), while subskills are awarded a split of the original raw damage exp.

Ex:
Enemy has 100 hp.
Enemy is worth 10 exp.
Your first weapon is a sword(swordmanship).
Your weapon scales off of Brute force by 0.5.
Your weapon scales off of Technique by 1.
Your weapon scales off of Finesse by 0.5.

Your second weapon is a hammer(bluntarms).
Your weapon scales off of Brute force by 2.
Your weapon scales off of Toughness by 0.5.
Your weapon scales off of Technique by 0.5.

You deal a total of 50 damage with your sword,
then you swap to a hammer and deal the remaining 50 damage.

The enemy will construct a separate damagetable for both weapons.
First your weaponskills get their raw copied share of exp = 5 exp swordmanship, 5 exp bluntarms.
Then your subskills get their original exp split according to scaling:

Sword:
50/100hp * 10 exp = 5exp
2 bf + 0.5tn + 0.5fi = 3 total scaling
Brute force gets 2bf / 3 total scaling * 5 exp
Technique gets 0.5tn /3 total scaling * 5 exp;
Finesse gets 0.5fi /3 total scaling * 5 exp;
etc.

Lemme know what you think of this system, I feel it's more nuanced than the old power handling balance that were leveled so evenly that it pretty much had zero impact.

VERY conflicted atm on if I should change to raycast combat(like most fpses and the old mod) because of balance issues between weapons. Polearms will be superior in every way just like in the real world as you can just kite and deal damage.
Thoughts are welcome.

Streamlined my enemy class.(no longer uses weapon damage values, thus no longer need stats either)
Added enemy levels.
Added levelup particles/light.


Graphics
Downloaded some swords and a toon shader(just to see what it'd look like). The result was BorderSword: Masterlands!
Felt inspired so I made some custom particle effects that fit the aestethics, was actually surprised at how good my touchpad paint star looked as a sparkle effect on a blade.

For reference, here is the extremely pathetic looking star: https://gyazo.com/0ff0adbf1f2eba99684cc996d20a5fd4
Here is after I've worked my wonders: https://gyazo.com/fe80aa890087bf5bb97e1ce4d4906a31
Excuse the FPS, this would run at above 1k fps on my own computer lol.


Misc
Added player titles according to your skill level balance.
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
I've looked over some documentation and examples, and I'm confident that one could ping a masterserver for a reference to all hosted listenservers, and show them in a list on a scoreboard, which would give a result much like the one you described, Thothie.

Host migration is integrated into Unity UNET now as far as I can tell from the documentation, so migrating host SHOULD be as easy as calling a method.(probably not though)



I've managed to set up a simple multiplayer now, but I don't feel like I have the energy to climb the rest of this mountainous task just yet, especially since I've got zero experience and I'm more than likely to just set off an avalanche that ruins all the code beneath on the way to the top. I've also set up a fix for lag-related rubberbanding by interpolating using a vector3 list of positions that gets added to when remote clients move over a certain threshhold distance(to avoid unneccesary packets) that the local client will iterate through using a lerp function.

I've been fiddling with a non IRC-chat system for hours now and I've been unsuccessful in making it two-way just yet.
I made it using unity objects etc instead of strings, which would mean that one could reference itemID's and get a tooltip popup when you hover over it(exciting prospect to accomplish if you ask me), but this also brought about the difficulties involved syncing gameobjects across the network, as the host also has authority over the listenserver so only the host can chat(the others can only see it) at the moment.

REALLY frustrating, been bashing my head against this code too long now, need a break.
 

Jelly

Adventurer
MSC Developer
RiP
Joined
Nov 25, 2005
Messages
1,909
Reaction score
15
Age
31
Location
You are here --> X
I cannot with confidence say that this is the best method of doing this, but when I last took on a synchronous multiplayer game in Unity, we also used authoritative servers, with the server telling each client when and what to spawn (entities) AND what unique integer id to give them. It worked fine, and an extra integer per message is not going to be the straw that breaks the camel's back.

This was with the old Unity networking though, so I'm sure there are more elegant ways to handle it now. :)

EDIT:
Links I found useful when messing with synchronous mulitplayer.
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
https://developer.valvesoftware.com...rver_In-game_Protocol_Design_and_Optimization
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Jelly said:
I cannot with confidence say that this is the best method of doing this, but when I last took on a synchronous multiplayer game in Unity, we also used authoritative servers, with the server telling each client when and what to spawn (entities) AND what unique integer id to give them. It worked fine, and an extra integer per message is not going to be the straw that breaks the camel's back.

This was with the old Unity networking though, so I'm sure there are more elegant ways to handle it now. :)

EDIT:
Links I found useful when messing with synchronous mulitplayer.
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
https://developer.valvesoftware.com...rver_In-game_Protocol_Design_and_Optimization


Servers are always authorative in Unity now. Problem is that when hosting a listenserver, the host is also the server thus his client is also authorative in the sense that he can run native server commands without explicit authority.
This slows down the debugging process, and even more so when I have to compile a new build for every single iteration I do, on this slow computer that takes 2 minutes to compile(this means a single character change in a code will take me 2 minutes to test).


The easiest way would be to have a chat GUI on the server, thus only having one instance of it and then updating it with the commands(strings) the player issues. Problem is spawning does not seem to be retroactive at this moment, as the NetworkServer.Spawn() method only applies to clients that are ready, meaning this chat works when it's spawned AFTER all clients have joined, but not for any new clients that join thereafter.


Another way to implement it would be to have a chat GUI that is on the client, but for it to have any connection properties it needs to be spawned on the client THROUGH the server(or else it will only exist on the client, not the server), which opens a whole other can of worms(rampant amounts of chat GUIs that will show for everyone and overlap) as this would mean that they NEED to be running and enabled to sync their content variables to other clients chat GUIs.

I was planning to use IRC for chat but when I added the C# IRC library from sourceforge it was so riddled with compile errors that I felt it wasn't worth the intense amount of effort to fix it.

Anyways I've had a relaxing break(played a concert), worked out some and had a fantastic dinner, so I'll look at some code again now. If anyone is interested in chatting we could probably find an IRC channel on freenode
 

Jelly

Adventurer
MSC Developer
RiP
Joined
Nov 25, 2005
Messages
1,909
Reaction score
15
Age
31
Location
You are here --> X
Pazrico said:
NetworkServer.Spawn()

After a quick look through of the documentation it smells like they still don't offer a proper networking interface.
You may be better off building the interface yourself with RPC's or using Photon (haven't tried it myself, but I've heard it's great).
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Well on the bright side my frustration apparently turned into a networkserversimple chat server haha. I'll split it so one program builds the server and the others are clients, right now they are on the same build.


Server is running in the background there.
https://gyazo.com/b378a2b31391897f6e71095f886be44f

It's based off of NetworkMessages(these are miniscule bits of information and this all has extremely small overhead)

This has channel creation support coded in, just not client side atm.
I could probably do that in a couple of minutes.


Plan is to have a single central server with all the channels on,
and when you transition to a map, you automatically join the local channel for that map.
This means that despite running your own instance with your friends, your local chat for that map would be interconnected with all the other instances of that map, generating some feeling of population despite the relative isolation. This would also allow you to just hang out in the Thornlands chat and satisfy the curiosity of new players in chat haha. Makes me all giddy just thinking about it.

The channel creation would make party chat possible etc too.
This all runs separate from the regular Unity Game Network as far as I can tell, meaning you can be connected to two servers at once. Perhaps I can somehow ship game instance IPs through this system and generate a scoreboard server list like Thothie envisions too. Too early to tell for me atm tbh, I'm kinda overwhelmed by my own effort at actually getting this to work(I was unable to find a code framework for something like this so I had to manually experiment from the bottom up with zero prior experience on network coding).

Looking at my own code right now I don't even have a clear picture of how it's set up, I guess I should start practicing good coding ethics and start commenting my code because this would look fucking alien to anyone but me.

/rant over

Now comes the task of integrating this into the other networking project with players, and seeing how it works from there
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Progress!

I've only had small amounts of time so I've only been able to do small implementations here and there.

Separated the chat Server and Client.(Client no longer has any authority, and can't even create channels).

Server: https://gyazo.com/a18ae5ee64d0d99a90daca873cca3714
Client: https://gyazo.com/79e717a8d19f610d98b51b5a6a1e0670

[*]Server now has simple tools to create customizeable channels(I can probably add any feature you can come up with here within the realms of reason).
[*]Server will write error message to client if trying to join a channel that is null.
[*]Client will now get a timeout warning when he can't connect to the server.
[*]Minor GUI fixes, tweaks and additions.
[*]Every channel now has both an unique name, and a group alias.
[*]The name of a channel will not be show to a player, only it's alias(I can change this if need be).
This is so one can simply create a channel called Edana, give it the alias Local and the player will only see it as local, but it can be referred to in code so as to change channel when joining a new map.
[*]Atm I've made 4 channel aliases: Global(only one can exist), Local, Party, Guild(all color coded).




I haven't made support for user created channels yet(dunno if I a user to manually do this, and instead have the game query the creation of a channel under the party alias when the player joins a party).
I'm thinking guilds can only be added to by the server manager which facilitates for having to officially approve of guilds).
 

Monika's_BFFEx0256

Old Skool Apostle
Joined
Mar 9, 2009
Messages
1,359
Reaction score
70
Funny how one man can do significantly more in a week than an entire dev team can do in 10 years :p
 

Pazrico

New Adventurer
Joined
Nov 30, 2012
Messages
21
Reaction score
0
Guys I don't mean to cause any tension here, so please don't think badly of the dev team.

He is right, this is "on Unity after all".(as I have mentioned earlier, with Unity you pretty much only code on top of the engine that is already in place, but then again the UnityEngine has a solid amount of power and utility)

If you haven't done it yet, you'd be surprised at the amount of quality games
small teams have made using Unity, so you should check out what Unity can offer
before you think so negatively about using it.

One thing I've learned about programming, is that nobody cares how much effort went into it,
they only care about the result. So if you can spend 30 minutes doing the same thing that
would take you 300 minutes otherwise, why wouldn't you take the short route if not out of spiteful pride?

Imagine what this small dev team could do if they all worked together using Unity?
The amazing thing about Unity is that a level designer has so many coding and animation options
that requires no knowledge of those things on their end, meaning they can themselves implement
lots of map quirks without necessarily needing to rely on a new script or animation.
I always found this video to be a good example: https://www.youtube.com/watch?v=9qhH9GWLtRo

If you think scripting for MS:C was easy, then you will find coding for Unity equally easy.
You get incredibly simple tools(and some more powerful and advanced ones) that feel
really intuitive and allows you to only have to focus on coming up with a solution or implementation
that is only limited by what you can come up with yourself. The only tool you need to build a house
is a hammer, after all.

If you want to I'll clean up my atm very messy code for the chat and post it here.
I'll even comment it if you'd like, just to help fire up a spark under "Master Sword: Unity" hahah.


I managed to get a concussion when boxing so I'm declared unfit for duty this week, will probably be
doing some more programming.
 
Top