This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Piorjade's profile picture

(MMO)RPG game [WIP] [client-server system]

Started by Piorjade, 26 June 2016 - 03:52 PM
Piorjade #1
Posted 26 June 2016 - 05:52 PM
I saw that a very low amount of users here try to make RPGs or games in general (now compare that amount to the amount of users trying to make operating systems :P/>), that's why i decided to make that game.

(Yes, I don't have a title for this thing, I would appreciate suggestions…)

Current features:
  • client login/register (enter server ID, pings server, enter username, checks for users, if found: login - if not found: register, hashes & adds salt to the password and saves it on the server)
  • server (handles: register, login, delete, change pw, spawn player into world, move player(s), sends movement every 0.1s to all players (i made use of coroutines here…), sends world-data (the map and it's data, for example blocks where the player can't go through) upon spawn command to player)
  • map editor (draw your map (MAXIMUM X = 25; MAXIMUM Y = 9) and then type: editor.lua <folderWhichCONTAINSTheMap> <PathTo: editorlayout.nfp>) (Standard locations: editor.lua = /server/maps/editor.lua; editorlayout.nfp = /server/maps/editorlayout.nfp; standard command = /server/maps/editor.lua <folderWhichCONTAINSTheMap> /server/maps/editor.nfp
  • chat system: Players connected to the same server can chat with T (NOTE: the game won't synchronize while typing, meaning movement and received messages won't be seen)
Planned:
  • more features for game and editor (making use of ladders, doors, etc. ;)/>
  • adding chat DONE :)/>
  • adding list of objects to the editor
  • NPCs (no AI though … to complex for meh)
  • (context) menus (inventory, exit, talk with NPC, etc)
  • fighting system (I have no idea how I should do this :P/>)
How to set-up:
  • download the server to a computer (pastebin run LwmeZ6SL /)
  • download the client to the PCs which should connect to the server (and "play") (pastebin run 0TbYns2m /)
  • run the server startup / reboot the server
  • run the client (startup.lua)
  • enter the server ID
  • enter username
  • it goes directly to the register screen ( next time you enter the username it will go to the login screen)
  • go to "Play" and press enter
  • there you go, you are in the map named "house1"
How to change the player's current world (with the current version):
  • shut down the server (terminate)
  • go to /server/saves/USERNAME/
  • edit "data"
  • edit the string "world" to the desired map
  • OR: Connect the worlds with ladders and use them
Controls:
  • GAME : Move: arrow keys; Use ladder: Enter; Chat: T
  • EDITOR: Save &amp; Exit: delete key
NOTE: you will see your (and the other) name(s) on the bottom and on the right of the map, the right means which players are on YOUR map and the bottom shows EVERY player on the whole server

NOTE2: to place block in the editor, enter the object in the textbox located below the map

Object list (editor):
  • wall (blocks player movement)
  • door (no use, can't even place)
  • ladder (no use)
Changelog:
Spoiler
  • Added new SHA-256 hashing with salt ( BLAKE-256 ) (Thx to Lemmmy )
  • Deleted old and added another SHA-256 API (because the old was broken)
  • Forgot to salt passwords, added that
  • REWORK: moved the "map-system" to the client, because a critical bug occured (look at the comments at the "getworld" function for more information and I would appreciate it if someone knows how to fix it)
  • Updated the mapeditor to proper place ladders (NOTE: after you place a ladder, the editor asks for the name of the destination map. The problem is that it somehow doesnt write the destination to the *.lvlDat file. Just open the *.lvlDat file and under "ladderDestination" write the maps by hand. If you have multiple ladders, you have to write the destinations proportionally to the laddersX and laddersY tables (e.g. laddersX[1] = 2, laddersY[1] = 2, ladderDestination[1] = <whereever the ladder at 2, 2 should lead to)
  • Draw and make use of ladders for the client: Stand NEXT TO a ladder and press enter to teleport to the specified map (but to the same X and Y coordinates you were standing before. NOTE: the client needs to have the map, of course)
  • Added chat system (read "Current features" for more)


Code:
SERVER: GitHub
CLIENT : GitHub
Edited on 16 September 2016 - 03:58 PM
Lemmmy #2
Posted 26 June 2016 - 06:05 PM
why do you encrypt passwords, you're supposed to hash and salt them
Piorjade #3
Posted 26 June 2016 - 06:07 PM
Oh sry I meant hashing. I use SHA-256 btw



EDIT: I forgot to spread the message: gaben.tv
Edited on 26 June 2016 - 04:10 PM
Lemmmy #4
Posted 26 June 2016 - 06:11 PM
do you salt it too

also why did you include your entire git folder in the pastebin that's just stupid
Piorjade #5
Posted 26 June 2016 - 06:18 PM
dude I bundled the files into one self extracting file to make it easier to download, there is no problem with that at all? If you want to see the source code I could give you the GitHub links…

EDIT: I think I know what you meant wait a second gonna fix that
EDIT2: There you go, no github stuff in the pastebin anymore, thanks for mentioning it
Edited on 26 June 2016 - 04:23 PM
Piorjade #6
Posted 20 July 2016 - 04:06 PM
UPDATE:
  • Forgot to salt passwords, added that
  • REWORK: moved the "map-system" to the client, because a critical bug occured (look at the comments at the "getworld" function for more information and I would appreciate it if someone knows how to fix it)
  • Updated the mapeditor to proper place ladders (NOTE: after you place a ladder, the editor asks for the name of the destination map. The problem is that it somehow doesnt write the destination to the *.lvlDat file. Just open the *.lvlDat file and under "ladderDestination" write the maps by hand. If you have multiple ladders, you have to write the destinations proportionally to the laddersX and laddersY tables (e.g. laddersX[1] = 2, laddersY[1] = 2, ladderDestination[1] = <whereever the ladder at 2, 2 should lead to)
  • Draw and make use of ladders for the client: Stand NEXT TO a ladder and press enter to teleport to the specified map (but to the same X and Y coordinates you were standing before. NOTE: the client needs to have the map, of course)
Edited on 20 July 2016 - 02:07 PM
boyscout415 #7
Posted 03 September 2016 - 05:31 PM
Maybe add a combat system, and some decorations? in that order, if you do.
Piorjade #8
Posted 04 September 2016 - 07:08 PM
Maybe add a combat system, and some decorations? in that order, if you do.

Thank you for your reply :)/>

First of all I really don't know HOW to implement fighting… I mean like Final Fantasy or Pokemon Mystery Dungeon, for example.
And second of all I didn't touch this project for a while now mainly cuz noone really replied to this :P/> (Though I updated my OS, because I was motivated enough lmao)
Piorjade #9
Posted 16 September 2016 - 05:44 PM
UPDATE:
  • Added Chat System (the game pauses while writing, that means that you won't see player movement… I did that because I couldn't get the Cursor to stay on it's coordinates WHILE synchronising with the server…)
  • Chat System is not connected with the Server, you only have to be on the server and the protocol is set to [serverID], which means only peeps on the same server can read your messages