Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Project Nitro [ Node | TypeScript | TypeORM | WebSockets ]

Status
Not open for further replies.
Junior Spellweaver
Joined
Jan 28, 2013
Messages
157
Reaction score
104
Project Nitro
Background

Project Nitro was started in November 2018 originally written in Java. After playing with Java for a couple months I got the urge to want to move everything I've done into Node. The Node community was lacking and we already had a few Java projects going and I wanted to do something different.

The project has been going strong and has had very active development for the past 6 months, I haven't gone a single day without writing a line of code into it.

I couldn't have done this without the community. This project is inspired by Kepler & Arcturus.
Goal

Project Nitro aims to be a fully featured emulator. The ending goal is to have every single feature in the SWF available.


Technologies



  • [*=1]NodeJS
    [*=1]TypeScript
    [*=1]TypeORM
    [*=1]MySQL
    [*=1]WebSockets (ws)
    [*=1]
Information

While there is still a lot of features not completed, I have made great strides and have a lot of the core features working and properly implemented. I estimate it will take another 3-6 months, or by the end of the year, to complete most feature available.

A unique feature included in this emulator by default is WebSockets. My socket implementation is, I'd say, very unique compared to other ways I've seen of doing it. There will be an included CMS I've written that entirely communicates over websockets with the emulator. The CMS uses packets from the emulator to render its data. This allows for instant updates and to add any custom feature you'd like that uses any packet from the emulator.

You're probably(not) wondering how session management works. What I've done is your CMS session and Game session are the exact same session, exact same object and share the exact same data. This means packets can easily be passed back and forth. The emulator controls which client will ultimately end the session. When logging into the CMS you appear online to your friends, can chat, view inventory and everything else that is available to the SWF ( must be coded in the CMS also ).

Current Features:


  • [*=1]Session Management
    [*=1]Hotel View
    [*=1]Rooms

    • [*=1]Rendering
      [*=1]Multi Unit
      [*=1]Wall & Floor Items [ Placement, Movement, & Rotation ]
      [*=1]Settings
      [*=1]Public Rooms
      [*=1]Give & Remove Rights
      [*=1]Chat [ Whisper, Shout, Normal ] with radius
      [*=1]Pathfinding

      [*=1]Doorbell / Password / Hidden States
      [*=1]Users

      • [*=1]Dance
        [*=1]Actions [ Sit, Wave, Laugh, Blow Kiss, Idle ]
        [*=1]Signs
        [*=1]Respect

      [*=1]A lot more

    [*=1]Catalog

    • [*=1]Purchasing
      [*=1]LTD Purchases

    [*=1]Pets

    • [*=1]Have only started horses
      [*=1]Pick Up

    [*=1]Bots

    • [*=1]Change Name
      [*=1]Copy Looks
      [*=1]Relax
      [*=1]Dance
      [*=1]Pick Up

    [*=1]Messenger

    • [*=1]Add
      [*=1]Delete
      [*=1]Search
      [*=1]Chat
      [*=1]Categories

    [*=1]Item Interactions

    • [*=1]Dice
      [*=1]Exchange
      [*=1]Gate
      [*=1]Multi Height
      [*=1]Pet Jump
      [*=1]Stack Helper
      [*=1]Teleport
      [*=1]Vending Machine

    [*=1]Wired

    • [*=1]Very early development on wired
      [*=1]Triggers

      • [*=1]Enter Room
        [*=1]Says Something
        [*=1]State Changed
        [*=1]Walk on Furni

      [*=1]Effects

      • [*=1]Teleport
There are a lot of other things done that I can't think of

The project at its current state can be found on GitHub:
I won't be posting any code snippets here, just check the git. However here are some gifs:








 
Last edited:
Banned
Banned
Joined
Aug 25, 2009
Messages
431
Reaction score
190
Been keeping an eye on your progress already. Looks like a really promising project. Best of luck!
 
Newbie Spellweaver
Joined
May 24, 2013
Messages
99
Reaction score
13
this emulator is performing better than one done in C#? of course, I say a good emulator in C# without being full of problems and poorly done code and memory leak.

I hear Node is pretty scalable for applications on gaming servers.
 
Elite Diviner
Joined
Apr 5, 2014
Messages
464
Reaction score
223
Great project!

One note though; doing all the room processing in the main thread will most likely screw you over, have a look at perhaps? :blushing:
 
Junior Spellweaver
Joined
Jan 28, 2013
Messages
157
Reaction score
104
Great project!

One note though; doing all the room processing in the main thread will most likely screw you over, have a look at perhaps? :blushing:

I'll check it out! I have done testing and performance has been great, but haven't done anything to crazy yet... Didn't really think about child processes as JS is single threaded so didn't bother looking into anything like that.
 
Elite Diviner
Joined
Apr 5, 2014
Messages
464
Reaction score
223
I'll check it out! I have done testing and performance has been great, but haven't done anything to crazy yet... Didn't really think about child processes as JS is single threaded so didn't bother looking into anything like that.

I was surprised not to find any documentation/examples of implementations of it in typescript. Here's how i'm using it if you are interested. Note that the module requires node v10.5+ and the --experimental-worker arg (it works with ts-node)

Code:
[COLOR=#333333][COLOR=#4b69c6]import[/COLOR] [COLOR=#7a3e9d]WorkerFarm[/COLOR] [COLOR=#4b69c6]from[/COLOR] [COLOR=#777777]'[/COLOR][COLOR=#448c27]worker-farm[/COLOR][COLOR=#777777]'[/COLOR]

[COLOR=#7a3e9d]const[/COLOR] [COLOR=#7a3e9d]userWorkers[/COLOR] [COLOR=#777777]=[/COLOR] [COLOR=#aa3731][B]WorkerFarm[/B][/COLOR]([COLOR=#777777]{[/COLOR] autoStart[COLOR=#777777]:[/COLOR] [COLOR=#9c5d27]true[/COLOR] [COLOR=#777777]},[/COLOR] [COLOR=#7a3e9d]__dirname[/COLOR] [COLOR=#777777]+[/COLOR] [COLOR=#777777]'[/COLOR][COLOR=#448c27]/workers/update_user_states.ts[/COLOR][COLOR=#777777]'[/COLOR])


...


[COLOR=#4b69c6]export[/COLOR] [COLOR=#7a3e9d]const[/COLOR] [COLOR=#aa3731][B]tick[/B][/COLOR] [COLOR=#777777]=[/COLOR] [COLOR=#777777]([/COLOR][COLOR=#7a3e9d]space[/COLOR][COLOR=#777777]:[/COLOR] [COLOR=#7a3e9d][B]Space[/B][/COLOR][COLOR=#777777])[/COLOR] [COLOR=#7a3e9d]=>[/COLOR] [COLOR=#777777]{[/COLOR]
[/COLOR][COLOR=#333333]
    [COLOR=#7a3e9d]let[/COLOR] [COLOR=#7a3e9d]start[/COLOR] [COLOR=#777777]=[/COLOR] [COLOR=#7a3e9d]process[/COLOR][COLOR=#777777].[/COLOR][COLOR=#aa3731][B]hrtime[/B][/COLOR]()


    [COLOR=#aa3731][B]userWorkers[/B][/COLOR]([COLOR=#7a3e9d]space[/COLOR][COLOR=#777777],[/COLOR] [COLOR=#777777]([/COLOR][COLOR=#7a3e9d]state[/COLOR][COLOR=#777777]:[/COLOR] [COLOR=#7a3e9d][B]StateUpdate[/B][/COLOR][COLOR=#777777])[/COLOR] [COLOR=#7a3e9d]=>[/COLOR] [COLOR=#777777]{[/COLOR]


[/COLOR][COLOR=#777777]        ...[/COLOR]
[COLOR=#aaaaaa][I]        // since the worker cannot mutate data from this process,[/I][/COLOR]
[COLOR=#aaaaaa][I]        // it instead returns instructions like which user walked where[/I][/COLOR]
[COLOR=#aaaaaa][I]        // which is then updated here and broadcasted to users[/I][/COLOR]
[COLOR=#777777]        ...

[/COLOR][COLOR=#333333]
[COLOR=#aaaaaa][I]        // get elapsed time[/I][/COLOR]
        [COLOR=#7a3e9d]let[/COLOR] [COLOR=#7a3e9d]end[/COLOR] [COLOR=#777777]=[/COLOR] [COLOR=#7a3e9d]process[/COLOR][COLOR=#777777].[/COLOR][COLOR=#aa3731][B]hrtime[/B][/COLOR]([COLOR=#7a3e9d]start[/COLOR])
        [COLOR=#7a3e9d]let[/COLOR] [COLOR=#7a3e9d]diff[/COLOR] [COLOR=#777777]=[/COLOR] [COLOR=#7a3e9d]end[/COLOR][[COLOR=#9c5d27]0[/COLOR]] [COLOR=#777777]*[/COLOR] [COLOR=#9c5d27]1000[/COLOR] [COLOR=#777777]+[/COLOR] ([COLOR=#7a3e9d]end[/COLOR][[COLOR=#9c5d27]1[/COLOR]] [COLOR=#777777]/[/COLOR] [COLOR=#9c5d27]1000000[/COLOR])

[COLOR=#aaaaaa][I]        // schedule a new execution 500ms after this tick started[/I][/COLOR]
        [COLOR=#aa3731][B]setTimeout[/B][/COLOR]([COLOR=#777777]()[/COLOR] [COLOR=#7a3e9d]=>[/COLOR] [COLOR=#aa3731][B]tick[/B][/COLOR]([COLOR=#7a3e9d]spaces[/COLOR][COLOR=#777777].[/COLOR][COLOR=#aa3731][B]get[/B][/COLOR]([COLOR=#7a3e9d]space[/COLOR][COLOR=#777777].[/COLOR][COLOR=#7a3e9d]id[/COLOR]))[COLOR=#777777],[/COLOR] [COLOR=#9c5d27]500[/COLOR] [COLOR=#777777]-[/COLOR] [COLOR=#7a3e9d]diff[/COLOR])

    [COLOR=#777777]}[/COLOR])

[COLOR=#777777]}[/COLOR]



[/COLOR]
 
Status
Not open for further replies.
Back
Top