Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Code examples and program structure guidance

Author
Message
Cordeval
20
Years of Service
User Offline
Joined: 29th Jan 2004
Location:
Posted: 31st Jan 2004 19:42
Code: DBc
I am starting on a game that is a translation to the computer of a tabletop miniatures tactical game.

The tabletop game ahs certain features inherent to the rules that need translation to the computer.
A rectangle represents a certain number of soldiers, a "unit". The tabletop rules run the movement of the rectangles (i.e. can move corners of the unit no more than 2 inches in any direction). every rectangle is the same width, some have longer or shorter sides.

What I want to do with DBc is move the rectangle certain distances of matrix space within the 3D world. Later on I would like to place soldiers within the rectangle and let them move only within the rectangle while the code moves the rectangle about. Hiding the rectangle of course. Setting up the rectangles properly for managing the figures later would be, I think, wise. Can you guide me to code that keeps figures within a moving area.

There are many rules applying to the rectangles when movign them as groups and when moving to combat. For example, to move to combat, the full frontal face must contact the full frontal face of the enemy. I think the best way to manage this is to code "front left corner of mine meets front right corner of his; and, front right corner of mine meets front left corner of his." Can you point me to some code that would give me ideas in programming this?

Thanks from an enthusiastic DBc newbie.
spygamer
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 31st Jan 2004 22:40
Big words. I don't think people will understand those. Just kidding. Can you explain better, please.

I trying to be a moderator. I'm nice and cool 24/7.
Cordeval
20
Years of Service
User Offline
Joined: 29th Jan 2004
Location:
Posted: 1st Feb 2004 20:49
I'll try to re-state it.

1) I am applying movement rules to a 2D rectangle in a 3D world. Can you point me towards code that manages this kind of movement?
An example logic check from the rules is, "Does my front right corner overlap his front left corner and does my front left corner overlap his front right corner, if yes, do combat resolution".

2) I want, in the future, to place 3D figures within the rectangle and move them within the rectangle only. Can you point me towards code that moves a group group of figures as a military unit? Think of the units of soldiers at the beginning of the recent "Fellowship of the Rings" movie.

Thanks,
Dave "Cordeval" Dickey
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 4th Feb 2004 08:59
the only code that does what you want is code you actually write, that is without errors. Moving one 3D object from one place to another is just as simple (or hard) as moving a group of objects from one spot to another.... As these objects exist (or will exist) in your game, only you know the movement conditions....

can move through tree, underground, in air, over/under water, through other objects ...... speed of movement .....

Only you can solve this problem. Start small.

internet gaming group
current project http://home.comcast.net/~norman.perry/Archon.html
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Feb 2004 17:05 Edited at: 4th Feb 2004 17:08
As for the overlapping problem, go through a loop of each of your units. Each unit has a width range and a height range based on the size of the unit's rectangle. Now, create a nested loop that goes though the rectangles of each of the enemy units, check to see if any of the four corners of the enemy's unit rectangle are inside of the range of the unit that you are testing. If true, mark that enemy unit as in conflict with the current unit. Continue testing. At the end you'll have a list of your units that are in conflict the enemy units. From there you can add up the factors such as unit strength and make your combat resolution checks.

While each war game is different, I'm something of a war game designer. So, feel free to post questions and I'll see what I can do to answer them.
--
TAZ

Disclaimer: I started with DBP and I have not used DBC. So, if I do post any code, you might have to take it as psuedo code and modify it to work with DBC.

Login to post a reply

Server time is: 2024-09-21 18:12:15
Your offset time is: 2024-09-21 18:12:15