Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: ASCII Lab  (Read 7466 times)

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
ASCII Lab
« on: January 04, 2010, 04:03:25 am »

Thanks to the Hippoman topic, I decided to post this.

I've written a simple C# .NET library that uses Direct X and handles 2D sprites, TTF text and provides a simple interface for keyboard and mouse input. I have a couple test projects that use it and I can post some examples/more info here.

It could be a quick way to write up an 'ASCII' game (it's all bitmaps, of course). By default, it uses a 16x16 tileset that I got for DF and can render any of the tiles in any colour combination for foreground/background. PNG transparency is supported, of course.

So, I'd like to know if anyone would be interested in this?

I made it because I've been thinking of throwing together an adventure-style game with the library. It might be fun to collaborate, if someone wants to do that.

Why C#?

C# uses C-style syntax, it provides very good performance, and it makes things much easier when compared with C/C++. If you're new to programming, it will definitely be easier and faster to learn.

Limitations
TTF text is experimental and not very useful, at this stage.

Starting out
Starting a project is very simple. Just start Visual Studio Express and click on the template to make a default application.
Important: It seems you'll have to locate the GroboLib.dll, manually. Right-click on references and select 'Add'. Then, Browse and locate the DLL in templates.

Requirements:

DirectX Updates
http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en

Visual C# (Express)
http://www.microsoft.com/express/vcsharp/

.NET Framework (3.5)
http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en

Download
http://www.sendspace.com/file/6zcm9j

Installation
Unzip the file into My documents\Visual Studio 2008\Templates\ProjectTemplates

Example code
For fun, here is some example code. Just create a project and add these files to it. The code demonstrates a little with classes and what-not. The player can be any creature.
http://www.sendspace.com/file/jtqv79

Controls:
U - Add a human at the mouse pointer
D - Add a dwarf at the mouse pointer
G - Add a goblin at the mouse pointer
E - Add an elf at the mouse pointer
K - Kill (remove) the creature at the mouse pointer

Arrow keys move the player.
Mouse-over shows the creature name.

Screenshot
Spoiler (click to show/hide)

Demo
http://www.sendspace.com/file/59n7zq
A binary demo game, similar to the above code but with a few changes:

X - Kill (remove) the creature at the mouse pointer
K - Add a kobold at the mouse pointer
C - Cut down tree at the mouse pointer

This version has a simple friend/enemy battle system. Certain races will attack others and defend others.
« Last Edit: January 17, 2010, 08:47:47 pm by Lightman »
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #1 on: January 04, 2010, 04:31:34 am »

But, but I just started using game maker!
I've spent about 20 hours trying to make the guy walk and jump, and bump walls smoothly already.

Also, How far different is C# from java?
Is memory managed?
Do you have any ideas in mind?
Download link.
Logged

Hippoman

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #2 on: January 04, 2010, 08:20:19 am »

Thanks to the Hippoman topic, I decided to post this.

I've written a simple C# .NET library that uses Direct X and handles 2D sprites, TTF text and provides a simple interface for keyboard and mouse input. I have a couple test projects that use it and I can post some examples/more info here.

It could be a quick way to write up an 'ASCII' game (it's all bitmaps, of course). By default, it uses a 16x16 tileset that I got for DF and can render any of the tiles in any colour combination for foreground/background. PNG transparency is supported, of course.

So, I'd like to know if anyone would be interested in this?

I made it because I've been thinking of throwing together an adventure-style game with the library. It might be fun to collaborate, if someone wants to do that.

Why C#?

C# uses C-style syntax, it provides very good performance, and it makes things much easier when compared with C/C++. If you're new to programming, it will definitely be easier and faster to learn.

Starting out
Starting a project is very simple. Just click on the template and it makes a default application:


You did this just to piss me off didn't you...
"Thanks to the Hippoman topic...I'll program this in C#."
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #3 on: January 04, 2010, 11:19:08 am »

Dear Hippoman: Stop seeing insults where there are none. The internet does not revolve around you, as you are but a single step above anonymous. Most people would be content that they started a fad.
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #4 on: January 04, 2010, 04:56:16 pm »

Hippoman
More like, your thread sparked my interest in posting about a library I had written already. ;)

eerr
Yes, C# is managed and it shares many concepts with Java. I'll post links and more info, soon.

For my ideas, my initial impulse was just to make a 'siege defence' game to try implementing some battle fun. However, it would be cool to make a little adventure game... preferably something open-ended with some exploration. Obviously, nothing near the DF scale but it is tempting to make something so I can add a couple features I'd like to play around with.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #5 on: January 04, 2010, 06:20:48 pm »

Light->"Hippoman
More like, your thread sparked my interest in posting about a library I had written already. "
Dammit man, you know this stuff makes a great christmas present...

I've got ideas, and Am interested.
but I wouldn't want to start building without you.
Not that I can, considering you haven't posted the link to Mediafire yet.

Actually, What C# Environment do you use?
Logged

Hippoman

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #6 on: January 04, 2010, 06:34:48 pm »

Hippoman
More like, your thread sparked my interest in posting about a library I had written already. ;)
:C I still wish it was actually in a language I knew...
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #7 on: January 04, 2010, 06:37:01 pm »

eerr, from the looks of it he uses Visual C#.
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #8 on: January 04, 2010, 06:48:24 pm »

Awhile back, Someone posted bugged code in C++. Debugging that code,(which took me about a week, as I really don't know C++) Taught me with great detail how pointers work. If anyone has a very hard C# sharp debug..
Logged

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #9 on: January 04, 2010, 07:07:31 pm »

Well, the difference between C++ and C# is that everything in C# is a pointer... Well, that's a very general statement, but in general every object you work with is a pointer to an object. There are no hard memory locations that you don't make yourself using unsafe code. I've not had a need to use unsafe code while using the language, but then again, I'm just a hobby programmer.

Also, I have nothing that is hard to debug that I don't actively want to debug myself. Sorry.  :(
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #10 on: January 04, 2010, 07:27:38 pm »

Hippo
You could always learn. Knowing multiple languages is a good thing. If you're learning C/C++, it will be easy for you to pick up.

eerr
Willfor is correct. I use Visual Studio Express, which is nice and free.

Willfor
Well, yes, the idea of managed code is not to make the user manage memory ;) ... And, a little more accurately, any class-based variable is a pointer. Struct-based variables are not passed by reference.
Logged

Hippoman

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #11 on: January 04, 2010, 07:40:52 pm »

Well yes, but that'll be in a long while.
Logged
THPÆCROSSISM
ΘπÆ┼ - Rise up against our superiors! Let all dwarves be equal!
KHDownloads

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #12 on: January 04, 2010, 10:03:05 pm »

Well yes, but that'll be in a long while.
We're not 7 years old, you don't have to get the last word in every dam time.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #13 on: January 04, 2010, 11:20:40 pm »

I have an idea I would like to pursue, as you haven't mentioned anything specific. Though I do want to download the engine before I commit to anything.

The idea?
You are a wizard who places boulders, like a tower-defense Dwarf-fortress hybrid.
Lightning and boulders are primary tools, but you will use and gain others.
Logged

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: ASCII Lab
« Reply #14 on: January 05, 2010, 07:45:30 am »

I'm interested... I don't know if I could help much though since I've never tried to jump that from c++ -> c# gap. 

But it might prove useful to open my mind...

maybe we can chat later.  Just add my mail.
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.
Pages: [1] 2 3 ... 5