473,396 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RPG fight engine.

I'm writing a fight engine for a fantasy role-playing game.

The program involves monsters of various types as well as player characters,
using different weapons and also casting spells. There will also be objects
in the game which the characters can interact with, for instance if a spear
is thrown it will lie on the ground, ready to be picked up.
The problem is that the program needs to be extended so that everytime
someone come up with a new idea, say a new monster or a moving platform, it
can be easily incorporated.

I have to use either C or C++, and I've decided to do with C.

Has anyone designed a similar program? Any advice on how to go about it?
Nov 15 '05 #1
6 1788
Malcolm wrote:
I'm writing a fight engine for a fantasy role-playing game.

The program involves monsters of various types as well as player characters,
using different weapons and also casting spells. There will also be objects
in the game which the characters can interact with, for instance if a spear
is thrown it will lie on the ground, ready to be picked up.
The problem is that the program needs to be extended so that everytime
someone come up with a new idea, say a new monster or a moving platform, it
can be easily incorporated.

I have to use either C or C++, and I've decided to do with C.

Has anyone designed a similar program? Any advice on how to go about it?


The header of your message seems authentic, so I really wonder
what you smok^H how you contracted the idea to ask this question
here. It is certainly off-topic.
Please find some more appropriate place.

<OT>
In case you are not kidding: Fake object orientation in order to
make enough room for the unpredictable; this means that the add-ons
can go into a library and can be described either in terms of the
default capabilities or can bring capabilities of their own.
</OT>

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 15 '05 #2
Malcolm sade:

Has anyone designed a similar program? Any advice on how to go about it?


Look at Angband and its use of Lua.

Tobias
--
IMPORTANT: The contents of this email and attachments are confidential
and may be subject to legal privilege and/or protected by copyright.
Copying or communicating any part of it to others is prohibited and may
be unlawful.
Nov 15 '05 #3
"Malcolm" <re*******@btinternet.com> wrote:
I'm writing a fight engine for a fantasy role-playing game.

The program involves monsters of various types as well as player characters,
using different weapons and also casting spells. There will also be objects
in the game which the characters can interact with, for instance if a spear
is thrown it will lie on the ground, ready to be picked up.
The problem is that the program needs to be extended so that everytime
someone come up with a new idea, say a new monster or a moving platform, it
can be easily incorporated.


Let me guess. It should also be user-friendly, _and_ it should allow
complete freedom. Forget it. You can have either, but not both. If you
merely want new sets of objects with different parameters, you can do
that with a simple realloc()able array of structs, and a structured text
file, but you're only going to get variations on existing elements that
way. If you want to allow completely new behaviour, you will have to
implement a whole new script language layer; and if you do _that_, you
will be up to your ears in users complaining that this is tooo
haaard!!1!. Still perfectly possible in C, of course.

Richard
Nov 15 '05 #4

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote
[ RPG fight engine ]
Let me guess. It should also be user-friendly, _and_ it should allow
complete freedom. Forget it. You can have either, but not both. If you
merely want new sets of objects with different parameters, you can do
that with a simple realloc()able array of structs, and a structured text
file, but you're only going to get variations on existing elements that
way. If you want to allow completely new behaviour, you will have to
implement a whole new script language layer; and if you do _that_, you
will be up to your ears in users complaining that this is tooo
haaard!!1!. Still perfectly possible in C, of course.

What is really wanted of course is a reality simulator. So if the designer
specifies Yetis with icicles the engine automatically models fur, refraction
to make the icicle look realistic, and invesre kinematics as it runs down
the mountain.
That's beyond my skills to provide.

I'm considering three basic options.

1) hard code everything, and add more code as the designers add more
elements. This is easy, but the problem is that the structre of the program
will steadily degrade as we hack about with the location routines to add in
the moving platform.

2) fake up object-orientation by providing an interface system. This is what
I'm currently thinking of doing. The problem is that the syntax gets really
horrid because C isn't designed to do this.

3) Implement a scripting language. Effectively the program will no longer be
in C at all, but it still acceptable because I can run it through a C
compiler, which will be the interpreter. The problem is, can the scripting
language be powerful and flexible and stable enough to do what I want?

Which would you go for?
Nov 15 '05 #5
Malcolm sade:
3) Implement a scripting language. Effectively the program will no longer be
in C at all, but it still acceptable because I can run it through a C
compiler, which will be the interpreter. The problem is, can the scripting
language be powerful and flexible and stable enough to do what I want?

Which would you go for?


The script can be C as well. Look at a TinyC-parser and just add an
interpreter. Otherwise, as I pointed out before, look at Lua, a
script language that some major game developers use to extend
functionality; it's completely free and apparently powerful. Or if
you want something more similar to C, AngelScript.

http://www.lua.org
http://www.angelcode.com/angelscript/

Tobias
--
IMPORTANT: The contents of this email and attachments are confidential
and may be subject to legal privilege and/or protected by copyright.
Copying or communicating any part of it to others is prohibited and may
be unlawful.
Nov 15 '05 #6

"Tobias Blomkvist" <vo**@void.void> wrote
The script can be C as well. Look at a TinyC-parser and just add an
interpreter. Otherwise, as I pointed out before, look at Lua, a
script language that some major game developers use to extend
functionality; it's completely free and apparently powerful. Or if
you want something more similar to C, AngelScript.

http://www.lua.org
http://www.angelcode.com/angelscript/

Thanks. Lua may well be the answer to this one.
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Patrick | last post by:
Are the differences between a search engine, a subject directory and a meta search engine significant for an ebusiness web site owner? A meta search engine merely uses ordinary existing search...
1
by: Carl Waldbieser | last post by:
Has anyone had any experience embedding a CPython engine in a .NET application? In the COM/ActiveX world, it was pretty easy to use Mark Hammond's win32 modules to create a script engine component...
3
by: John Hann | last post by:
Hi, A friend of mine is in the process of building a 3d game engine using native DirectX in C++. I would like to contribute to the development of an editor for this engine, but I would prefer to...
0
by: dtsearch | last post by:
New release expands-through a .NET Spider API, to Linux, and to OpenOffice-dtSearch's ability to index over a terabyte of text in a single index, with indexed search time typically less than a...
0
by: dtsearch | last post by:
A new beta build offers 64-bit developer access to dtSearch's "terabyte indexer," and preliminary MS Word 2007 and Excel 2007 support (in both 64-bit and 32-bit versions) BETHESDA, MD (July 22,...
1
by: Divided Sky | last post by:
Is there an msbuild-specific discussion group? Also, is there an msbee discussion group that is active? Is there a good resource for info about using Microsoft.Build.BuildEngine.Engine class? ...
1
by: final farewell | last post by:
Hello, I am using Ekhau Location Tracking System for an assignment. It is a system that is able to track configured tags attached to people or objects. I am new to the Ekahau Location Tracking...
1
by: SingingDoughnut | last post by:
Can someone please help with some code? I have been making a game, but there is a problem with one scenario. When the playable character encounters an NPC and they fight, the game keeps going until...
16
by: Duncan Booth | last post by:
Google have announced a new service called 'Google App Engine' which may be of interest to some of the people here (although if you want to sign up you'll have to join the queue behind me): From...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.