Jump to content


Photo

Creating A Nightmist Database


  • Please log in to reply
38 replies to this topic

#1 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 01 April 2005 - 10:58 PM

If anyone is interested in creating a database driven helper I took an hour to create a simple model.

You'll need to be familiar with C# to turn it into a proper database program.

It is split into three applications.

The first application is the viewer program, which allows you to view files in the database.

The second application is the editor, which allows you to view, update, and remove items in the database.

The last application is actually a class library that contains the templates for each item, and code to load and save them to a file.


The only thing I added was the template for adding Weapons to the database. The editor only allows you to edit the weapon description, although the viewer displays all the information. To complete it you will need to add tabs for other types of item in the editor, and add the rest of the buttons and labels to allow editing of the other properties.

This is quite technical, and you will need to be familiar with C# or at least willing to learn it to be able to complete this application.
However, most of the difficult code is already present, and I will answer sensible questions if you get stuck.

If you find any bugs then let me know.


The viewer and editor programs load Database.nmd from the same folder as the executable.

You will need Visual Studio .NET or similar to edit the application. You will need the .NET Framework to run this application (found on windowsupdate or the microsoft site).

Download the full source code and compiled projects here.


If you alter the class library then your database will no longer load, because it will be a version mismatch. Therefore you should complete the application design before you use it.
If you build it, they will come.

#2 Momba

Momba
  • Members
  • 670 posts

Posted 02 April 2005 - 06:51 AM

Don't do it!!! It is a keylogger. He invaded my PC and now has all my midget porn passwords. ^_^

Nice work Simon. Thanks for taking the time.

Edited by Momba, 02 April 2005 - 06:51 AM.

My inner child is a mean little f*ucker

#3 Crane

Crane

    "Teh Gareth!"

  • Members
  • 4091 posts

Posted 02 April 2005 - 09:40 AM

Good work. I would gladly help, but I unfortunately do not have Visual Studio .NET.
The Crane Temple Chairman

Main crits:
Crane
Europa


Don't kill the messenger mathematician!

#4 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 02 April 2005 - 02:14 PM

this mean i should stop working on my helper?

#5 Steam

Steam
  • Members
  • 395 posts

Posted 02 April 2005 - 05:29 PM

this mean i should stop working on my helper?

I thought your helper was going to be made so that it helped you learn VB? does it matter if someone else is doing a similar project, althiough this is quite a bit different. if this is the case then why did you start one if Jurians was out tehre?
Mckay: I passed out from manly hunger

http://www.youtube.com/steam56

#6 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 02 April 2005 - 08:49 PM

this mean i should stop working on my helper?

I wrote this because you expressed an interest in writing a helper but didn't know how to make it database oriented.
If you build it, they will come.

#7 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 02 April 2005 - 09:31 PM

in VB, not C# ^_^

#8 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 02 April 2005 - 09:55 PM

VB isn't a suitable language to use database. In fact it isn't suitable for anything.

You should take this opportunity to learn a much better language.
If you build it, they will come.

#9 Sean

Sean
  • Members
  • 976 posts

Posted 02 April 2005 - 10:14 PM

Nm was coded in VB lol
Stadic Ingame...

#10 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 02 April 2005 - 10:45 PM

Nm was coded in VB lol

go figure... lol :P

i suspect nightmist 2 isn't in VB then. I might start to learn C# actually, but i have to go through the trouble of downloading all the crap for it, then actually getting the motivation to learn it ^_^ Taken me so long to be arsed to start learning VB lol. Plus, the game engines i use (ORE, Mirage Source) are in VB, and i use them alot.

#11 JLH

JLH

    Administrator

  • Admin
  • 1771 posts

Posted 03 April 2005 - 03:25 AM

nm2 is vb
Anything i post on here is subject to change at any time without notification to the board.

#12 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 03 April 2005 - 04:09 AM

Yup the nightmist 2 server is definately VB.


Oops I misplaced my emphasis.
If you build it, they will come.

#13 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 03 April 2005 - 12:29 PM

oh jeez... please don't do it in VB, or atleast do the server in C#

#14 JLH

JLH

    Administrator

  • Admin
  • 1771 posts

Posted 03 April 2005 - 01:47 PM

why? lol
Anything i post on here is subject to change at any time without notification to the board.

#15 Crane

Crane

    "Teh Gareth!"

  • Members
  • 4091 posts

Posted 03 April 2005 - 07:25 PM

Erm... VB (as far as I know) does not support Pointers, is not fully object-oriented, cannot typecast variables, does not have a built-in assembly language (God forbid you should need to use that anyway!), is not very versatile... and now I am really going off-topic!
The Crane Temple Chairman

Main crits:
Crane
Europa


Don't kill the messenger mathematician!

#16 Sean

Sean
  • Members
  • 976 posts

Posted 03 April 2005 - 07:39 PM

C is faster too
Stadic Ingame...

#17 JLH

JLH

    Administrator

  • Admin
  • 1771 posts

Posted 05 April 2005 - 01:06 AM

in general, yes.
however the nm server is only using a few % of the cpus, so not really an issue (and as mentioned in the off-topic thread on vb, vb compiles to c code anyway).
the main thing vb lacks is decent support for multi-threading, that would come in handy for the hourly database save so it doesn't pause the game for a few seconds.
Anything i post on here is subject to change at any time without notification to the board.

#18 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 05 April 2005 - 05:10 AM

You can't thread the database save anyway because if it's written to while it's saving you'll get a discrepancy...

VB lacks structure and objects which are more important than threading anyway.
If you build it, they will come.

#19 JLH

JLH

    Administrator

  • Admin
  • 1771 posts

Posted 05 April 2005 - 06:36 AM

good point about the database
good job i don't use objects then ^_^
Anything i post on here is subject to change at any time without notification to the board.

#20 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 05 April 2005 - 08:11 AM

good point about the database
good job i don't use objects then ^_^

Ah but you do, the monsters being reference numbers to an array is a very clumsy inefficient way of implementing a object-oriented approach =)
If you build it, they will come.

#21 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 05 April 2005 - 02:03 PM

atleast we're still kind of on the topic of "a Nightmist Database" haha.

as long as it works i guess. just remember to ALWAYS COMMENT YOUR CODE. messy code is one thing that annoys me alot.

#22 Steam

Steam
  • Members
  • 395 posts

Posted 05 April 2005 - 02:33 PM

FIGHT!!!!!!!!!

JLH vs Pandilex

hehehe ^_^
Mckay: I passed out from manly hunger

http://www.youtube.com/steam56

#23 Sean

Sean
  • Members
  • 976 posts

Posted 05 April 2005 - 06:46 PM

lol
Stadic Ingame...

#24 JLH

JLH

    Administrator

  • Admin
  • 1771 posts

Posted 05 April 2005 - 08:53 PM

good point about the database
good job i don't use objects then ^_^

Ah but you do, the monsters being reference numbers to an array is a very clumsy inefficient way of implementing a object-oriented approach =)

well, when i wrote it, i wasn't thinking in the "object-oriented" way, and I will admit, i know nothing about how it works, and i know nothing about c# (and don't have the time to look into it or vb.net).
so if you say it's better, i'll believe you since you know both languages and so can compare them whereas i can't :P
Anything i post on here is subject to change at any time without notification to the board.

#25 Steam

Steam
  • Members
  • 395 posts

Posted 05 April 2005 - 11:41 PM

JLH wins for being the bigger man ^_^
Mckay: I passed out from manly hunger

http://www.youtube.com/steam56

#26 Sneaky

Sneaky
  • Members
  • 2372 posts

Posted 06 April 2005 - 03:20 AM

Look inside the 2 am phone convo's with JLH and Pandilex. ^_^
Chuck Norris wears Jack Bauer pajamas.

deimos the noob said no


#27 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 06 April 2005 - 08:16 AM

VB.net is nothing to jump around about anyway. Definately wouldn't recommend it for ANYTHING, unless using it for website stuff.

#28 Pandilex

Pandilex

    Administrator

  • Admin
  • 568 posts

Posted 06 April 2005 - 08:54 AM

VB.net is nothing to jump around about anyway. Definately wouldn't recommend it for ANYTHING, unless using it for website stuff.

You use ASP.Net for website stuff. VB.Net is pointless, C# is much better.
If you build it, they will come.

#29 Xlithan

Xlithan

    Discord Moderator

  • Members
  • 1050 posts

Posted 06 April 2005 - 01:19 PM

ASP has similar syntax to VB doesn't it? Not sure about VB.net though. Anything with .NET at the end of it is bound to be a complete waste of time though.

#30 TheNobleOne

TheNobleOne
  • Members
  • 74 posts

Posted 06 April 2005 - 02:09 PM

Just because it is called .Net does not make it only website oriented. Basically you run webservices and or remoting by coding it in C# or VB.Net. However, C# and .Net are very very viable for making normal applications as well just like C++ or VB.

Since I am very proficient in C# I will take a look at the code and see if I can finish it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users