Skip to content

Roleplaying overlay for Guild Wars 2, written in Unity/C#.

License

Notifications You must be signed in to change notification settings

sunija-dev/warp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARP - The Guild Wars 2 roleplaying overlay

WARP Trailer

WARP is the unofficial roleplaying overlay for Guild Wars 2 for Windows. Its main features are

  • See roleplayers on the map
  • Easily to switch to their shard
  • Write/read roleplay profiles

>> Download <<

Website / Discord

--- This is an early release of the repository. So you'll find many unfinished notes here. ---

What can I do with this repository?

Can I…

…make a roleplaying overlay for another game?

Yes! Many games support the MumbleAPI, which is the core piece to make WARP work. Though, don’t forget to replace the GW2 graphics, because ArenaNet would not allow their usage despite for GW2 fan projects.

…make an overlay for GW2 with it?

Yes, BUT a BlishHUD module would be the better way to do that. It is also written in C#, though it does not use Unity. I still highly recommend it, since you’ll save yourself from fixing my (slightly shaky) overlay code. And the installation will be wayyyy easier for your users.

…add features to WARP?

Kinda. WARP uses a dedicated server. When you edit the code, it won’t work with the WARP server anymore. You will have to host your own server and then you can basically make your own roleplaying overlay. If you intend on doing that, I’d recommend reaching out to me on Discord (username: sunija), so maybe I can help you.

…slap in some 3D graphics from the asset store and make my own roleplaying MMO?

Surprisingly, yes. WARP works like a full indie-MMO, though without the graphics and input (which are currently coming from the GW2 game that runs next to it). It definitely needs work, but I guess it’s not the worst project to start from, if you want to do something simple.

…copy some scripts 1:1 and use them in my commercial game?

Yes. This repo uses the very permissive MIT license.

…copy the graphics and use them in my game?

NO. The graphics belong to ArenaNet and are not covered by the license.

License

The WARP code is released under the MIT license, unless noted otherwise (e.g. for external code). If you find code that is not properly credited, please let me know.

Artworks/graphic assets from Guild Wars 2 belong to ©2024 ArenaNet, LLC and are not covered by the MIT license.

Technology

Engine: Unity, C#

Overlay: BlishHUD / CodeMonkey

Networking: Mirror, with a “client + dedicated server” architecture

Server: Ubuntu vServer

History

2020 Mar - German beta

2021 Aug - International beta, new design

2021 Dec - 1.0 release

2024 Mar - Open sourced

Known bugs

  • Disappearing on alt-tab
  • Window sometimes off-screen

Documentation

How2Build

  • Download
  • Install Unity 2019.4.24f1
  • Run server
    • Build WARP for Linux (headless)
    • Put Linux build on server (via ftp, eg. filezilla)
    • Put server_files on server
    • Connect to your server (via ssh)
  • Run client
    • Build WARP for Windows
    • Run start_server.sh
    • Run your windows build
    • Run Guild Wars 2

Full build (with patcher, starter, utility):

  • Open warp_patcher and build it
  • Open warp_starter and build it
  • Open warp_utility and build it
  • Put the libraries of warp_utility in warp_unity/Assets/external
  • Open warp_unity (as shown above) and build it

Releasing a new version

  • You have to run it on your server
  • Unity: set the version number (in the build settings)
  • Make a build windows
  • Throw the warp_starter files into it
  • Zip it
  • Upload the zip to the web path hardcoded in the patcher (atm weltenrast.de/warp/recore/WARP.zip
  • Make a linux build (needs to have same version number)
  • Zip it, make upload it
  • (TODO: Add remaining steps)
  • (make a test build)
    • don’t add starter

Server

  • Ubuntu vServer
  • 2 cores
  • 4 gb ram
  • 120gb harddisk
  • Location: Germany (WARP is not as ping dependant, so it works of the whole world)
  • → Can be rented for less than 5€/month

Let’s go through running WARP…

  1. To explain how everything works, let’s talk through using WARP and what happens in the background.

  2. Go to website https://gw2warp.com/ (wordpress, but I recommend bootstrap templates. They are free and don’t need maintenance)

  3. Run the patcher

    1. (image of patcher)
    2. The patcher will always
      1. Download the WARP build from a hardcoded address (atm https://weltenrast.de/data/recore/WARP.zip)
      2. Delete the WARP folder next to it, if there is one (to remove the old version)
      3. Unzip the warp folder next to it
      4. Start the warp_starter.exe in the folder
      5. (Yes, that means if people run the warp_patcher to start WARP, it will always re-download itself. Happened some times)
  4. The warp_starter

    1. The WARP starter
  5. (Setup process)

Projects Overview

WARP Patcher

The patcher is a simple “patcher”. It just download the new version from a hardcoded location, deletes the old warp folder, unzips the new one and starts it.

It’s main purpose is (as with any patcher, duh) to download WARP for the first time, and can be used to download new versions later on. Since the patcher itself doesn’t check if there is actually a new version, WARP only starts it if there is actually one.

Patcher is a single .exe file, all libraries build in. Didn’t want a .zip because unzipping is tedious and already hard for some common users. It is its own program and not part of the main executable, because it has to delete the old WARP files, and an executable cannot delete itself (I think…?).

WARP Starter

The WARP starter is a tiny program that starts WARP once GW2 is started.

It is necessary, because there’s no other way to only start WARP when GW2 is running. E.g. BlishHUD gets around this problem by just not closing itself when GW2 is closed - which is fine because it’s really lightweight in its sleep mode. But Unity isn’t as light-weight, so I wanted to close the main WARP program as often as possible.

The starter basically just checks every 2 seconds if there is a process that is called Gw2-64. If there is, and there is no warp process, it’ll start WARP. (Thinking about it, I think atm there’s a bug where the starter starts WARP in the account login screen, but WARP doesn’t recognize that window and closes itself, causing an annoying endless loop. 🤔)

The starter also causes the taskbar icon in the bottom right, from which the starter can be closed.

WARP Utility

WARP Utility is a c# library that provides code to handle parts of the overlaying, the MouseHook (=Input) and access MumbleLink.

This code cannot be part of the Unity project, because Unity doesn’t allow to import the System.Drawings library. And it might contain some nuget libraries (for the mousehook?), of which I didn’t know how to get them into Unity. 🤔 Getting this code into Unity would make working with it easier. On the other hand… once it is built, you rarely have to touch it.

This codebase is a horrible mess of copied-together code from BlishHUD (for overlaying and mouse/keyboard hooks), and half of the methods are maybe not called anymore because I was able to move them to Unity.

WARP Unity

This is the main project, which contains what you see ingame.

The project basically works like a full MMO with a dedicated server. Since it is build with Mirror, it uses the same project as client and server. When you build it for Windows it acts as a client, when you build it for headless linux it acts as server.

In a normal MMO you would move your character/camera with WASD+Mouse. In WARP you move your character/camera by moving them in GW2. WARP reads your new position/camPosition from the MumbleAPI that GW2 implements. So, WARP actually renders from the same position as GW2. Which means you could also put 3D objects in the world and they would render perfectly fine (though only as overlay, and not actually as part of the world. Kinda like X-Ray vision.).

Code Convention

  1. Simplified hungarian notation that I learned at game studios
    1. Put class abbreviation in front of var name. E.g. iPlayer for int, textName for TMP_Text.
    2. Also before classes (except void, duh)
    3. _ in front of parameter vars.
    4. Sometimes I used m_ for member vars.
  2. Hungarian doesn’t have the best rep, but I found it helps a lot. Especially because you often have multiple vars for one concept. E.g.
    1. Player = player class
    2. iPlayer = index of the player in a list
    3. strPlayerName = string, player name
    4. textPlayerName = text field that displays the player name
  3. Also, you can see what’s your code (= very likely to contain bugs) and build-in code (= less likely to contain bugs)
  4. And it’s harder to mess up variable names completely, even if you don’t have much time to think about them.

Translator Guideline

(Not super relevant, but might be interesting to see.)

Thank you for volunteering to translate WARP! :)

  1. General
    1. This is voluntary. Whenever new translations are needed, I’ll inform you about it. If you have time to translate: That’s awesome! If not, that’s also fine. Just tell me, so I can plan with it. ;)
    2. Credits Please write to me how you want to be credited on the “about”-page (e.g. your Discord name, your GW2 tag, both, …).
  2. Guidelines
    1. Informal language. “Du” instead of “Sie”, “tu” instead of “vous”. It’s a game after all. ;)
    2. Inclusive language. Whenever possible, address all genders.
    3. Short and understandable. Don’t have to translate 1:1, rather keep it as short and understandable as possible. Except…
    4. Exact wording for GW2 options/buttons. E.g. the “Windowed Fullscreen” option should be named exactly as in GW2. That makes it a lot easier for players to find them.
    5. Don’t force it. ;) If an English word is the common term for sth in your language, just keep it. No need to translate “login” if that’s the common word for it.
    6. No slurs. Obviously. ;) But also not if you are doing a temporary translation that is not intended for publication. If you put it in the sheet, it might appear like that ingame.
  3. Tech Tips
    1. Remove spaces from links/code. </ color > →
    2. Automatic translation. =googletranslate([click english field], “en”, “fr”)

Features

  1. Overlaying
    1. How to make overlay window
    2. Mouse hook
    3. Select on input field (because keyhook didn’t work)
    4. On Win10 is really easy, even in fullscreen now
  2. Inputs
    1. Via mousehook, because overlay should not have focus. Mousehook gets mouse positions and clicks and simulates them (which is possible with unity’s new input system)
    2. …but keyboard hook didn’t work out so well. Would be especially hard with special characters in french, german, etc. So instead, when you click on a text field it actually focuses WARP and you type directly in it. That’s done with a raycast that checks if you’re hovering a text field. That’s also why it is suggested to turn on the “play music if window is not focussed” setting in GW2 - otherwise the music stops when you click in a text field.
    3. The keyboard hook can simulate keyboard strokes though. That is used to put text in the chat (e.g., to send invites to players). In that case, it puts the text in the clipboard, presses Enter to open the chat, presses ctrl+v to paste it in, and then enter again to send it.
    4. Definitely do not overuse that functionality. ANet seems to be fine with that limited use, but using that tech to build spambots (or just regular bots) will definitely get you (rightfully) banned.
  3. Database
    1. Sqlite
    2. SqliteBrowser
    3. Easy to use sql library
    4. It is basically only used to dump information. Once you log in, everything is loaded to RAM. Even with the old version of WARP that had 1000+ items flying around, I’d load them all to RAM because I feared the DB would be too slow. Is that correct? I don’t know.
  4. Networking
    1. Mirror
    2. Client/Server in same project
    3. Player class is most important
    4. Explain Cmd, RPC, SyncVar
    5. Needs to be same build
  5. MumbleAPI
    1. Actually a library for mumble (= open source teamspeak = discord). Allows positional audio (= you hear people louder if they are close). Many games have it (Gw2, WoW, minecraft, …)= Games can implement this API to share your position to mumble. But can also be read from other games. Thus it’s the basis for a lot of overlays.
    2. MumbleDebugLog
  6. GW2 API + Login
  7. GW2 style ui
    1. Scraping
  8. Patching
    1. Server tells client it’s version with a network message. If WARP has an oldver
  9. Localization
    1. Uses unity’s localization system
    2. Can be connected to google doc. Send it people to localize (name localization people)
  10. Icon Selector
    1. Linq
    2. Scraped icons
  11. Character/Account sheets, Aspects, CloseCharsList
    1. Show on hover/mini charlist. Proximity displaying
    2. Saved to db
    3. Aspects are basically entries there
  12. Notes
  13. Character List
    1. Synced independently from sheets, because no proximity.
    2. If you wondered why you couldn’t check out profiles there… that’s it. I’d have to make a special request to get the sheet. I started that with “RequestableObjects”
  14. IP changer
  15. Admin commands
    1. Needs to be admin in db but still needs pw, because I don’t trust myself. I guess that’s 2 factor
    2. Not much there, could be more
  16. Feedback / Reports
  17. MapMarkers
  18. WikiMap
  19. Settings
  20. TreasureHunt
  21. Unfinished
    1. Dice
    2. EmoteBoard
    3. Spots

Feature Ideas (Not added)

  1. WARP Chat
  2. Items (again)
    1. aspects
    2. placing
    3. finding
    4. “plots”
    5. aspects
    6. item managment (my items, show in world, etc)
    7. inventory (+bank)
    8. feedback (how often picked up, likes,...)
    9. combination & logic (conditions)
    10. delete after some time
  3. See people you played with
  4. Set status
  5. Make better overview on sheet
  6. Thankuuuus
  7. Beginner Tutorial (like on how2rp.com)
    1. Master Guide
    2. Leveling Guide
  8. RP-Finder
    1. Classifieds (+ Sorting)
    2. Account pages
    3. Filter
    4. Suggestions
    5. Rumors
    6. Guild/Group ads
    7. (Ads in Loading screens)
    8. Group-Chats…?
    9. “Last played with”
  9. Community
    1. Worldchat?
    2. Post small infos about your RP
    3. Anecdotes (+ Likes), share funny or epic moments
  10. Personalization
    1. add quick buttons to windows
  11. Housing
    1. display objects
    2. housing zone
    3. show effects, dead people, ...
  12. RP-Tipps
    1. warp tutorial
    2. rp tips
    3. character creation gothrough
    4. notes about your character
  13. Debugging feature?
  14. Feedback
    1. start page
    2. write down diary (+ auto screenshots?)
  15. XP
    1. Likes
    2. Shop
    3. Boost-Zones
    4. XP bar (and fx)
  16. Calendar
  17. npc sheets (maybe if we spawn npcs…?)

About

Roleplaying overlay for Guild Wars 2, written in Unity/C#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages