Jump to content
MakeWebGames

Recommended Posts

Posted

Hi,

Was just wondering as somebody said he may want to look into a C# game engine, and thought, what if I would start a text game engine what would be the requirement? What would you need to have to be able to choose it yourself to create your game? Which feature will you make it pick up?

Here my initial list:

- Register / Login / Lost password

- In game "emails"

- In game player market

- Some sort of battles

- Some sort of jobs

- Player inventory

- Admin panel

Then what? Some suggestions? If I start something who would be interested to participate? At least in the feature list, and test?

On the tech side, it would be a C# 3.5 or 4 / ASP.NET and MySQL database using NHibernate.

Posted

It may have been me who said I wanted to learn C#. I'd love for you to make this, would we be able to see the code side of the game? Also, as I'm finishing school soon, I could attempt to learn some C#, and possibly help out on the project.

Posted

Basic game engine should be more or less as you have said with some kind of hook system.

So -

- login, register, inside menu & layout.

- home page for inside (showing money etc)

- Some basic kind of currency; I suggest money rather than adding things like crystals as well

- ability to change things in staff panel, including currency, game name, template, user info.

- More generalized pages, player profile, userlist, staff list, something like an explore page, player preferences.

Anything past this e.g. in game features should be add-ons. No default add-ons need to be installed, however there can be a mod pack with the following.

1) mail

2) attack

3) items

4) market (links into 3)

Along with anything else people feel would make it a basic, but playable engine. This way you could download either the framework alone or a more basic start where you end up with features near a very dull, but playable game.

Posted

Danny: Of course if I do it everyone will be free to check the sources.

Dom: templates in C# is a non-issue and I will try to explain why. In most if not all cases, the code is completely split from the HTML / CSS and even where the things are displayed as long as you keep the same stuff inside. For example if you code a page with a text field (input type=text) and a button (input type=submit) you may place those where you want, in the .aspx file which is nearly an HTML page, on the code side you simply access them by their name (which is an ID you define). So not hard to think this concept as a template engine ;) Also, the C# code is compiled in the DLL when you distribute it, which means the code is not distributed normally, the aspx file on the other side remains as it is, which means you may edit the look without editing the code.

Another particular feature of ASP.NET is the "Master Page" basically, think of a page which does the header / footer of any "child pages". So you may have there the stats, menu and much more without the need to re-code it every time. Again something C# / ASP.NET offers as base feature.

Yet for the hook system, there is multiple solutions, from a simple "here is the sources add your own stuff" to something a bit more sophisticate which would work like plugins and let you add mods to the engine without modifying the engine. In the first case of course it requires less work at start, but force you to edit the main engine code, where the second option would let you add mods without touching the engine and could have self-installing things.

BTW what's an explore page? Sorry I'm a McCode noobs....

Posted

Yet for the hook system, there is multiple solutions, from a simple "here is the sources add your own stuff" to something a bit more sophisticate which would work like plugins and let you add mods to the engine without modifying the engine. In the first case of course it requires less work at start, but force you to edit the main engine code, where the second option would let you add mods without touching the engine and could have self-installing things.

BTW what's an explore page? Sorry I'm a McCode noobs....

Explore is just a page with links leading to the markets pages, userlist etc. Zap has something like it, but I can't remember the name.

2nd would be a much better solution. No programming may get people on side quicker, and those who would help will anyway.

Posted

The question for me would be how to develop the base engine further.

I normally learn by way of looking at the code figuring how it comes together and then taking it from there. Not knowing C# at all at the moment then obviously it would be a learning curve however if the code comes pre-compiled into a dll then how would I be able to change it?

Posted

As I said I will give away the sources.

The DLL thing is how C# works, not to scare you away. Here is normally how you code in C#

.cs source code

C# compiler

.dll or .exe file as output

Now for an ASP.NET site you compile as before but you distribute the .aspx (template) and the dll

Also, as I doubt most of you have Visual Studio Pro, I will make sure it works with Mono Develop.

Posted

Ok first shot:

- You have a login & register page

- Once you are logged in you see a page with 3 columns, (menu, content, stats)

- The layout will be taken from this page to all game pages

- Layout is mainly done in CSS (with some tables for registrations or other but can be changed)

- Database uses MySQL via something called NHibernate, the idea here is that each table in the software is seen as a class, and you can access the data via C# as well as modify / insert it.

- Login will check username and password if succeed it saves the userid in the session.

Now to try it, you mainly have to open the solution and run it. At least with Visual Studio. I didn't tried yet with Mono Develop but it should work exactly the same way.

Before that however you need to create a database (on your own host) called sharpengine and create the table as defined in database.txt (not yet created an installer :p )

You may check in the hibernate.cfg.xml the config to connect to the database.

Full project here: http://base.nowhere-else.org/temp/engine/1.zip

Feedback and questions are welcome.

Posted

Us game owners already have enough competition without the great Alain getting involved :P

Just kidding around, are there many text-based browser games coded with C# ?

I hope your project goes well :)

Posted

Honestly I have no clues how many text-based browser games there is which are coded with C# / ASP.NET

There is a few reasons for it (that I can think of):

1) First of all, you need a few more tools to start with, where with PHP you basically can get free hosting, ftp and notepad and you are up and running.

2) PHP was there before ASP.NET was invented therefore there is more history behind, even if the code base behind C# is by far not smaller than PHP as even the .NET framework (which is base of C#) is much bigger than any PHP framework you may download.

3) C# tend to be more used in the professional world where people develop shops, huge dynamic web sites, and specially intranet solutions. Those people don't develop really that much web games, and if so tend to make complex one not like mafia one.

4) Also due to the way C# websites are developed, either it's closed source (you install and configure via panels / config files) or you get full sources, most ASP.NET developers don't give away their sources, and instead give away a complete ready to use software. This kind of thing doesn't work all that well for a game engine. So unless you release the sources or offer some convenient way to extend the game, you hardly will have customers for this kind of "game engine".

But mainly I believe kids (which are the primary owner / customers) of such text web games don't want to start working on something which is more than simply <?php echo "hello"; ?> files, and get scared by something which requires some background (objects, class, compiling and more) before having something.

BTW without any of you trying it and / or giving feed back this will be yet another dead project :p

Posted

Well Nhibernate is not something I use normally, but I wanted to keep on the free side of the software, so instead of using the usual library I use, I took NHibernate. I must say it's not as good as Devart LinqConnect but it does it job, at least for basic things which is what we need here I believe.

For those which are not aware of what I'm talking about first read this: http://en.wikipedia.org/wiki/Object-relational_mapping

Basically when you develop in an object oriented way, you may wish to save your objects directly on the database without having to issue tons of SQL statement yourself. So imagine a "myobj.save()" function which would do the work for you. Well basically that's the base idea behind an ORM. Now of course objects don't live alone, they often have links to others like, for example, a user object may have all its "sales" linked to it. Well that's again the job of an ORM to grab the sales when you do "myUser.Sales"

NHibernate does that for you.

Also, using an ORM usually have a few side advantages: not having to care about SQL, not having issue about checking your SQL by trying each and every functions, being able to change database vendor without changing anything inside your code (normally ORM solutions support multiple databases) and avoiding any sort of SQL injections, as you work always with the data types you expect, and the ORM will take care to issue all the "escape" functions or binding needed.

Posted

Ok well that was interesting but finally got stuck.

My windows server is not used much anymore as such it did not have asp.net 4 so had to install, set an application pool as I am on iis 6 and then change the test site to run on version 4

Next issue I had was with the theme. Parse error message could not find theme Default.

Removing the page="Default" in the config gets past that one however it then will not find the ~/Default.Master in the default.aspx

Bearing in mind I am troubleshooting just by looking at the code rather than knowing much about asp.net

Removing the ~/ takes it further to the message

Parser Error Message: Could not load type 'SharpEngine.Default'. Source File: /SharpEngine/Default.Master Line: 1

Posted

First of all you should try within the Visual Studio or within Mono Develop. If you want to run it on the IIS server it must be on it's own site (and this is where you have all those issues with the paths ;) )

A site on IIS can be either set to an IP or to a different name.

Posted

Odd because trying it on my own IIS doesn't lead to any error.

Just to be sure, did you compiled the solution? And did you deployed the files correctly? which means the directory which contains the web.config file is the top directory of the site.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...