Re: Text-Based RPG: Survival
Is there a question there?
Re: Text-Based RPG: Survival
Sorry, fixed. What I'm really wanting to know is if I can simply continue my work with Visual Basic 6 and expect to accomplish something along the lines I drew out in the OP.
Also, suggestions like "[x] would probably work well for the map." or "[z] would make your variable wildlife easier to program." are helpful.
So far, the table of contents in my VB6 guide has given me little to work with, and I've investigated most of the pages looking for something that seems like it would fit into the picture,
Re: Text-Based RPG: Survival
Re: Text-Based RPG: Survival
Sounds a little like the re-invention of the Text-Adventure to me. Perhaps with a more sophisticated player character.
You should be aware, that there exist programming languages specially for writing text based adventure-like games like ACode or MUDL (i think it was).
ACode makes writing maps and moves easy and will compile a C Source code for ANSI C which will then compile the final game. ACode is available under Unix/Linux. But it offers no user interface except console input. Maybe some more research reveals some newer or more contemporary game-developing languages...
In general I'd say VB6 is as good a choice as VB.NET or C#.NET.
Any language provides the means for a programmer to express himself, writing any program. VB always seemed to me an easy to learn language. There is no reason why you should not use it for your game project, like structuring data, creating objects with properties from classes, even accessing databases. It has every means and possibility you would possibly need. A user interface can easily be clicked together. So why not using VB?
Re: Text-Based RPG: Survival
WoF -
Thanks for the input. The only reason I didn't know if I could use VB is that, to a beginner, VB seems like a limited sort of language. Apparently your idea is that it is not, at least not limited enough to hinder the inclusion of some of my ideas.
I'll be looking up creating objects with properties from classes, and accessing databases with VB6 now. The kind of reply WoF made is exactly the kind I was hoping for, because it gave me a take-off point. Now, if I have trouble putting a part of my game into one of the suggested "possibilities" I have this thread for the questions/problems with that.
And any more suggestions are very welcome.
Re: Text-Based RPG: Survival
Also, I looked into MUDL and tried to find similar languages, but I'm coming up short. If anyone has any information pertaining to M$ languages that are used mainly for console gaming, feel free to share. I can't connect with Red Hat, fax modems suck.
Re: Text-Based RPG: Survival
Quote:
Originally Posted by wall_fall_down
Sorry, fixed. What I'm really wanting to know is if I can simply continue my work with Visual Basic 6 and expect to accomplish something along the lines I drew out in the OP.
Also, suggestions like "[x] would probably work well for the map." or "[z] would make your variable wildlife easier to program." are helpful.
So far, the table of contents in my VB6 guide has given me little to work with, and I've investigated most of the pages looking for something that seems like it would fit into the picture,
The main thing you should determine is if function pointers are going to make things easier for you. For example, if you have lots of different types of actions that the player (or critters) can take, then function pointers would make actions a lot easier to code. Also, if everything in the game shares certain attributes (such as heath, movement types, attacks, etc.), then a true class framework with inheritance would help a lot. That said, if what you have planned isn't that robust, VB6 will work fine.
Re: Text-Based RPG: Survival
You might want to consider one of the dot.net languages. The Express Edition of the compilers is free!
Re: Text-Based RPG: Survival
Quote:
Originally Posted by dglienna
You might want to consider one of the dot.net languages. The Express Edition of the compilers is free!
Any of them? Or a specific one? I'm willing to try just about a nything, and I've been looking up some "cheater" applications' (text adventure builders') source codes to see how some of them handle the elements of the games.
I looked up function pointers and found that VB6 is not made for them but -can- handle them, yet it still sounds silly that I'd be using something that my language was not built to do well.
I really am open to any suggestions, and would not mind trying out another language for this undertaking.
Re: Text-Based RPG: Survival
C# and VB.Net are good, although most prefer one or the other.
http://www.microsoft.com/express/
The have a Game Creator GDK but it's for C++.
Re: Text-Based RPG: Survival
Quote:
Originally Posted by dglienna
C# and VB.Net are good, although most prefer one or the other.
The C# version is a total of 827MB, and just the .NET framework seems to be 57 MB. Doing about 2 KB per second on local dialup means it'd take nearly 8 hours just for the framework. The entire setup for C# would take a little over 4 & 3/4 days.
My understanding says that I'd have to download the 8-hour .NET framework for both VB and C#. And then there's no telling what else comes with the respective languages.
I do have Dev C++, so I guess I'll be trying to make this in either VB6 or C++. If anyone has any suggestions for languages that require little downloading (<20 MB total is ideal) feel free to share, but otherwise I'm going to be trying things in VB6 for now.
Re: Text-Based RPG: Survival
Usually when you buy a computer language related book, you get an express version of that language. That's gone on for a long time. I had C# Express with one book, and VB6 in another.
Re: Text-Based RPG: Survival
Quote:
Originally Posted by dglienna
Usually when you buy a computer language related book, you get an express version of that language. That's gone on for a long time. I had C# Express with one book, and VB6 in another.
Guess this one comes down to making a trip to Barnes & Noble sometime soon. Or Half.com, who knows.
dglienna - Was the C# book helpful as you learned? If so, what was it called? Did the book remain valuable to you for only a short time in your learning?
I don't think that has anything to do with VB6... Nope, sure doesn't. Better balance that out by talking about VB some.
I've begun programming a time-of-day situation in which TimeOfDay is a string. Based on the value of the string, I have a lot of If TimeOfDay = "X" Then... / Else If etc. statements going on. The time of day/night is to be updated in-game every 10 minutes (1 game hour) and dawn/dusk both happen in three closely-timed stages (i.e. dawnEarly, dawn, and dawnLate.)
I've also considered trying to shift what hour of the day dawn and dusk occur, based on seasons. And yeah, I'm laughing at myself as well, because I' mreally making this more complex than it should be. But maybe I'm bored or something.
To sum that up, that's a TON of If-Thens inside more If-Thens. Are there any obvious alternatives that I'm missing here? Anything to make the time schedule seem like less of a mess?
This is all set up in notepad for now anyhow, and I'm just going to make the individually labeled "pieces" of programming (sorta like an outline of each major function) before I try fitting any of it together.
Re: Text-Based RPG: Survival
The book was Teach Yourself C# in 24 hours, so, yes, it was helpful. I also had been using VB.Net before, and wanted to check out the C# syntax.
I already had the compiler, but had never used it.
You need to look up the SELECT CASE statement:
Code:
SELECT CASE pennies
case 1
s="One Cent"
case 2
s="Two Cents"
case 3
s="Three Cents"
case 4
s="Four Cents"
case => 5
s="5+"
end select
msgbox s
Re: Text-Based RPG: Survival
Thanks, that was in my book, I should have seen it.
Re: Text-Based RPG: Survival
Two more considerations concerning Cominterns statements:
Function pointers might make life easier in some cases, but I think they can be avoided by consequent usage of objects and their methods.
But the look for a true class framework is an argument.
I think VB6 does not allow to inherit, but you can include base classes in more complex class definitions, so that's kind of an inheritance - yes, in a way. Don't nail me down on that.
What I liked at VB6 is the "simplicity" - well compared to VB.NET at least.
If I put a simple TextBox or a Button in VB.NET on a Form and look at the many, many properties - I have no idea about some of them. Same with other objects. It always strikes me down because there is so much more stuff as in VB6.
VB6 is less confusing for a beginner I think, and since you consider yourself a beginner I'm not sure what kind of complexity you will want to achieve. But as a programmer who has tried out many languages I'd always give BASIC to a beginner.
Beginners All Purpose Symbolic Instruction Code, as it were. :)
My opinion is: you can do (almost ;) ) anything with every language as long as you know the language. And VB IS easy to learn and to understand.
Re: Text-Based RPG: Survival
Quote:
Originally Posted by wall_fall_down
I've begun programming a time-of-day situation in which TimeOfDay is a string. Based on the value of the string, I have a lot of If TimeOfDay = "X" Then... / Else If etc. statements going on. The time of day/night is to be updated in-game every 10 minutes (1 game hour) and dawn/dusk both happen in three closely-timed stages (i.e. dawnEarly, dawn, and dawnLate.)
I've also considered trying to shift what hour of the day dawn and dusk occur, based on seasons. And yeah, I'm laughing at myself as well, because I' mreally making this more complex than it should be. But maybe I'm bored or something.
To sum that up, that's a TON of If-Thens inside more If-Thens. Are there any obvious alternatives that I'm missing here? Anything to make the time schedule seem like less of a mess?
When using variables that will have a set of fixed values it will be easier to use a UDT to build your variables and statements...
Ie..
Code:
Public Type Season as Byte
Spring
Summer
Autum ' Fall
Winter
End type
Public type TOD as Byte ' Time of Day
Midnight
EarlyDawn
Dawn
LateDawn
Morning
LateMorning
EarlyAfternoon
' Etc - you get the idea
End type
Public GameSeason as Season
Public GameTime as TOD
Public Sunup as TOD
Public Sundown as TOD
then instead of doing if then's with in If thens, rather try to build simple individual functions than can be called independantly ..
Code:
Private Sub SeasonChange
Select case GameSeason
Case Summer
Sunup = EarlyDawn
Sundown = LateDusk
Case Winter
Sunup = LateDawn
Sundown = EarlyDusk
Case Spring, Autum
Sunup = Dawn
Sundown = Dusk
End Select
End sub
Private Sub CheckDawnDusk
If GameTime = Sunup Then Msg="The Sun climbs slowly over the mountains"
If GameTime = Sundown Then Msg="The Sun slips slowly behind the mountains"
End Sub
Breaking everything down to the simplest function will effectivly leave your main program loop with a few checks and calls to the correct functions.
Also when building up your functions, try to work sequentially, IE: work out the functions for Hours first, then Days, then Seasons and Then Years. or rather start with the years firat and work everything in backwards towards the hours.. IE, Years affect the seasons crop size, Seasons affect the foilage and days temperature, the season affects the days sunup and sundown ...
You have a hell of a project ahead of you, but it will be fun, And many of us will be nearby whenever you need a little help with anything...
Gremmy...
Re: Text-Based RPG: Survival
Quote:
Originally Posted by WoF
Two more considerations concerning Cominterns statements:
Function pointers might make life easier in some cases, but I think they can be avoided by consequent usage of objects and their methods.
But the look for a true class framework is an argument.
I think VB6 does not allow to inherit, but you can include base classes in more complex class definitions, so that's kind of an inheritance - yes, in a way. Don't nail me down on that.
Good point, and it expands on what I was talking about in terms of "robustness". What inheritance and function pointers let you do is write one bit of code that is generic to all of the objects in the game. Take for example critters and actions. If there are a lot of actions that are common to all of the critters in the game (i.e. "move north"), then you have 2 options to greatly simplify coding. Make a base class with a "move" method that everything that can move inherits from and call the method from your derived object, or make a generic "move" function that you can pass arbitrary objects to. Either of these can be done reasonably in VB (although the require substantially more code and would be harder to later add onto).
Function pointers are more useful in your parsing code. For example, if you have a long list of legitimate actions that the player can take, it's much easier if you build a table of actions the correspond to functions and pass the rest of the string to the appropriate parsing function. This makes adding new functionality a lot simpler. This can also be done in VB, but again you will find that the amount of code and it's ease of extensibility will suffer.
One suggestion that I have is to scan through the code of other open source programs similar to the one you want to write and see how they are implemented. Then you should have a basic idea of how well they would translate to VB and other ways you could accomplish them. You may get half way through and have to re-write the entire thing from the ground up, but it's a great way to learn any language.
That said, I'd lean toward dglienna's suggestion and take a stab at it in .NET, especially if you're comfortable with VB. No sense learning on unsupported technology.
Re: Text-Based RPG: Survival
Erm... Gremmy?
Code:
Public Type Season as Byte
Spring
Summer
Autum ' Fall
Winter
End type
Which language are you thinking in at the moment? ;) This is not how UDT works in VB.
I think you want Public ENUM here.
And Enum does not take an AS BYTE spec.
I think you wanted:
Code:
Public Enum Season
Spring
Summer
Autumn
Winter
End Enum
Public TOY as Season
or something like that.
To quote ComIntern:
Quote:
You may get half way through and have to re-write the entire thing from the ground up, but it's a great way to learn any language.
True and true.
In case of a more complex program you have to do some real planning before coding or you end up rewriting everything more'n one times.
VBs class system is very much suitable for exting things later when more ideas come up if you use it consequently. Like Comintern was saying: if creatures have the same subset of properties like the player, then you'd define a class for that subset and let player and creatures inherit (or simply inplement) it.
Even if the saying goes VB6 is "not supported" by Microsoft anymore, full docs are still available in MSDN, and there's soooo much support here at CodeGuru, isn't it? ;)
Re: Text-Based RPG: Survival
Quote:
Originally Posted by WoF
Erm... Gremmy?
Code:
Public Type Season as Byte
Spring
Summer
Autum ' Fall
Winter
End type
Which language are you thinking in at the moment? ;) This is not how UDT works in VB.
I think you want Public ENUM here.
And Enum does not take an AS BYTE spec.
I think you wanted:
Code:
Public Enum Season
Spring
Summer
Autumn
Winter
End Enum
Public TOY as Season
or something like that.
O M G .. thanks Wof... You are so right... I was not thinking straight... That'll teach me to try a Serious code post at 11 PM, after a long day at work, with out checking it in a IDE first.....
Enum is what I was intending...
Gremmy...
Re: Text-Based RPG: Survival
Thanks everyone for having so much input... Rewriting the time systems now using the Enum and case instead... Makes it look much more tidy, doesn't it?
You guys have given me a lot to look up, and I appreciate it. I have looked for opensource games, but VB6 doesn't sound too popular.
And I made an extra fifty bucks for skinning two larger does, so I'm intending on going (20 miles!) to Barnes & Noble to try and find something about VB.NET. A supported language sounds appealing to me, and if I'm familiar with VB6 I assume the .NET won't be too traumatic of a change..?
As for actually timing the stuff out... I want it to be triggered by minutes of gameplay as I said, but my book leads me to believe I cannot.
The timer would be enabled to run when the player loads a game. I would like to call it perhaps every 20 minutes and advance it by X amount based on travel. However, before I get into trying to think up anything for the grid-location-specific travel advancement, I have to know if 20 minutes is possible.
I have considered the option of not using a timer event procedure, since my book tells me that these event procedures are limited to intervals of 65,535ms. So answer me this:
If I were to store the time in a variable, and then perhaps create a method of checking when
time = time + 20min
and then just use a case statement/other to make sure that morning follows daybreak, and noon follows morning... Would that work?
I would like to set up different times for dawn and dusk for each month as well, but I figure once I happen upon the smoothest trail I can easily duplicate & modify the same code, with a ticker to count months. The book I own teaches me a bit about making counters that use set values, so that every 12 months a year will pass and etc. so that's handled.
But my question here would be "is there some way of using the time = time + 20 script in junction with a statement that gives a different message for different times of day?
Thanks for being easy on the new guy, too. Last forum I went to treated me like crap because I was as green as the day I got cut.
Re: Text-Based RPG: Survival
Use DateDiff() to compute actual differences, in seconds, minutes, days, years, whatever.
Usually with a timer, I set it to 500 milliseconds (1/2 sec) and then keep track of clicks of the timer. The actual limit doesn't matter, as you keep track of clicks.