Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Main News about StarLife

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Do multiple scanners stack up and reveal the ships components faster?

I'm planning on not stacking up, although you could have more than one so if one scanner is destroyed the other would activate.
Having multiple ships with scanner would reveal the ships faster. The idea is to have scouts ships, the scanner will be a heavy and complex component that will make the ship expensive, you probably wouldn't be able to fit a scanner in every ship and fitting two of them is possible but even more expensive.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Oh God! I was screwing the parent variable of the objects, finally got it right after two weeks of random crashes. Starting AI.. finally..
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Finishing being able to shoot components.
To make things more interesting I added a range dissipation factor.
Very close: Damage*1.2
Midway : Damage*1
Very Far: Damage*0.8

This allows me to set a chance to hit a component that does not drop too quickly if far away and does not raise too quickly if too close.
So shooting a component from far away won't be too difficult but won't be as effective as shooting very close, while still being able to avoid close range weapons.
Shooting very close to the enemy will give you a damage bonus and chance to hit a component bonus but you will be in range of all your enemy weapons.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
oh god, it's starting to look organized
Code:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
setGraphicsType();
setRandomSeed();
setConfig();
 
TacticalSpaceCombatModule TSCM;
PlayerAIModule PAIM;
QDeclarativeView QDV;
 
setTwoPlayers(&TSCM,&PAIM,PlayerAIModule::Player,PlayerAIModule::AI);
setInitialData(&TSCM);
setViewConfiguration(&QDV);
setQMLInterface(&TSCM,&QDV,"Main.qml");
connectModules(&TSCM,&QDV,&PAIM);
 
PAIM.start();
 
return a.exec();
}

Code:
void setGraphicsType()
{
 QApplication::setGraphicsSystem("raster");
}
 
void setRandomSeed()
{
 QTime time = QTime::currentTime();
 qsrand((uint)time.msec());
}
 
void setConfig()
{
 g_config->file("./data/config.txt");
 g_config->update();
}
 
void setTwoPlayers(TacticalSpaceCombatModule *TSCM, PlayerAIModule *PAIM, PlayerAIModule::type P1, PlayerAIModule::type P2)
{
 TSCM->start();
 TSCM->playerList["player1"] = new ListModel(new ShipTemplateItem, TSCM);
 TSCM->playerList["player2"] = new ListModel(new ShipTemplateItem, TSCM);
 PAIM->setData(&TSCM->orderList,&TSCM->playerList,TSCM->mapTable);
 PAIM->setP1(P1);
 PAIM->setP2(P2);
}
 
void setShip(TacticalSpaceCombatModule *TSCM, QString Ship, QPoint Position, QString Player, QList<AbilityTemplateItem::cores> types)
{
 ShipTemplateItem *aux = NULL;
 aux = new ShipTemplateItem(*TSCM->getShip(Ship),Position,qApp);
 TSCM->playerList[Player]->appendRow(aux);
 for (int i=0;i<types.count();i++)
  aux->setHiddenComponent(types[i]);
}
 
void setInitialData(TacticalSpaceCombatModule *TSCM)
{
 setShip(TSCM,"Sh0F",QPoint(1,2),"player1",QList<AbilityTemplateItem::cores>()<<AbilityTemplateItem::Command_Center<<AbilityTemplateItem::Life_Support);
 setShip(TSCM,"Sh0F",QPoint(2,3),"player1",QList<AbilityTemplateItem::cores>()<<AbilityTemplateItem::Command_Center<<AbilityTemplateItem::Life_Support);
 setShip(TSCM,"Sh1T",QPoint(6,6),"player2",QList<AbilityTemplateItem::cores>()<<AbilityTemplateItem::Command_Center<<AbilityTemplateItem::Scanner);
 setShip(TSCM,"Sh2T",QPoint(7,8),"player2",QList<AbilityTemplateItem::cores>()<<AbilityTemplateItem::Command_Center<<AbilityTemplateItem::Life_Support);
 TSCM->calculateOrder();
}
 
void setViewConfiguration(QDeclarativeView *QDV)
{
 QDV->setMinimumSize(g_config->get_int("width"),g_config->get_int("height"));
 QGLWidget *glWidget = new QGLWidget(QDV);
 glWidget->setAutoFillBackground(false);
 QDV->setViewport(glWidget);
 QDV->engine()->addImageProvider(QLatin1String("loader"), new ImageProvider);
}
 
void setQMLInterface(TacticalSpaceCombatModule *TSCM, QDeclarativeView *QDV, QString qmlFile)
{
 QDV->rootContext()->setContextProperty("player1",TSCM->playerList["player1"]);
 QDV->rootContext()->setContextProperty("player2",TSCM->playerList["player2"]);
 QDV->rootContext()->setContextProperty("mapTable",TSCM->mapTable);
 QDV->rootContext()->setContextProperty("config",g_config);
 QDV->rootContext()->setContextProperty("engine",TSCM);
 if (qmlFile.contains("qrc:")) QDV->setSource(QUrl(qmlFile));
 else QDV->setSource(QUrl::fromLocalFile(qmlFile));
 QDV->show();
 QDV->setEnabled(false);
}
 
void connectModules(TacticalSpaceCombatModule *TSCM, QDeclarativeView *QDV, PlayerAIModule *PAIM)
{
 QApplication::connect(PAIM,SIGNAL(enableView(bool)),QDV,SLOT(setEnabled(bool)));
 QApplication::connect(TSCM,SIGNAL(turnEnded()),PAIM,SLOT(turnEnded()));
}
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
First AI will be as simple as possible.

Find closest enemy.
Move as close as possible to the closest enemy.
If in weapon's range, shoot.
Pass the turn.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Done, I'm working to release a demo now.
What I wanted to releasing in the demo but probably won't be available in this demo:
Be able to shoot components.
Be able to know where the engine is even if the ship was not scanned.
Be able to build your own ship.
Be able to deploy your ships.
Be able to build your own component.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Download the Space Tactical Combat Demo - Alpha 0.3

Download available: http://purpleorangegames.com/StarLifeTacticalSpaceCombatAlpha.7z

Scanner is in the demo, but you will be able to test it better in the next version, sorry about the great delay, I had to redo most of the code, I'm still clearing up some things and learning more about Finite State Machines so a lot of prototyping is happening right now.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Some interesting data:
Blog2008May2012May.png


It has lots of views from Brazil, my guess is it must be because of my facebook account.
When I post on the blog it automatically posts on my twitter that automatically posts on my facebook where I have mainly Brazilian friends. :M
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Hi there,

I'm planing on doing a mini game using the Tactical Combat before proceeding to the Empire Building part of the game.

The main reason is to have a place to test the AI and a way to make it possible to players to enjoy and provide feedback on it.

Here's a little screenshot of what's to come, you will understand when I post the video in the next few days:
http://2.bp.blogspot.com/-YDLZgGMqo...BXEhnRQyek/s1600/testeStoryInTacticCombat.png

testeStoryInTacticCombat.png
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
Finishing being able to shoot components.
To make things more interesting I added a range dissipation factor.
Very close: Damage*1.2
Midway : Damage*1
Very Far: Damage*0.8
I would think that for weapons that aren't beams, the damage would be largely invariant with respect to range. In space, a mass driver round isn't going to lose any of its momentum no matter how far it has to fly to get there. Your odds of hitting anything when firing at a target a few hundred lightyears away is going to be slim to none, unless it's a target following a completely predictable course for the next million years or so, but it will ruin someone's day just as surely as a mass driver round fired at point blank. Making this behavior depend on the actual type of weapon used will certainly make for interesting choices in weapon selection. Beams for mid-to-short range combat, missiles for combat at extreme ranges, and mass drivers for combat at either very short ranges, or cheaply bombarding things that can't move, probably in the "bombardment" phase of strategic combat resolution.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Finishing being able to shoot components.
To make things more interesting I added a range dissipation factor.
Very close: Damage*1.2
Midway : Damage*1
Very Far: Damage*0.8
I would think that for weapons that aren't beams, the damage would be largely invariant with respect to range. In space, a mass driver round isn't going to lose any of its momentum no matter how far it has to fly to get there. Your odds of hitting anything when firing at a target a few hundred lightyears away is going to be slim to none, unless it's a target following a completely predictable course for the next million years or so, but it will ruin someone's day just as surely as a mass driver round fired at point blank. Making this behavior depend on the actual type of weapon used will certainly make for interesting choices in weapon selection. Beams for mid-to-short range combat, missiles for combat at extreme ranges, and mass drivers for combat at either very short ranges, or cheaply bombarding things that can't move, probably in the "bombardment" phase of strategic combat resolution.

I have done just lasers for now so it still makes sense.
I'm still thinking about other types of weapons and how would they fare.

But one thing I'm considering is not the actual damage the weapon has, it's the actual damage made to the ship.
For example if you shoot two times with your mass driver one hit may cause no harm to the ship because it penetrated the hull but there was nothing important there to be damaged, but the second shot may penetrate and cause some structural damage by hitting a sensitive part of the ship, even it does not hit a certain component.
So in theory some shots may cause more damage depending on where it hits, how well it penetrates..
With this in mind, considering a part of this damage is caused by the skill of the shooter then it would mean that if you're near your enemy you have more chance to make a good shot and if you're far you will probably hit but you can't be sure to cause the same amount of damage.
And then there's dissipation, so other weapons may follow the same pattern but the beam type of would would suffer more from firing from far away.

Does this makes sense?
 

Malakal

Arcane
Glory to Ukraine
Joined
Nov 14, 2009
Messages
10,281
Location
Poland
Once you code all the stuff in you can focus on balancing and adding modifiers, too early for that now.

But yes, it makes a lot of sense. Helps differentiate weapons too.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Once you code all the stuff in you can focus on balancing and adding modifiers, too early for that now.

But yes, it makes a lot of sense. Helps differentiate weapons too.

Yep, once I get more stuff done I will start adding different types of weapons.
The main reason I added this modifier now was to test the AI.
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
But one thing I'm considering is not the actual damage the weapon has, it's the actual damage made to the ship.
For example if you shoot two times with your mass driver one hit may cause no harm to the ship because it penetrated the hull but there was nothing important there to be damaged, but the second shot may penetrate and cause some structural damage by hitting a sensitive part of the ship, even it does not hit a certain component.
I would think that in both cases, the damage caused would be about the same, except that in the first case, the damage is dealt to stuff that isn't important.

With this in mind, considering a part of this damage is caused by the skill of the shooter then it would mean that if you're near your enemy you have more chance to make a good shot and if you're far you will probably hit but you can't be sure to cause the same amount of damage.
I'd think that, outside of range dissipation, the "chance of making a good shot", as I previously suggested, would be based on the fact that at closer range, the shot cone covers a smaller area of the target, making it more likely that the round actually happens to go where you want it to go. Of course, if you have no idea what you're doing, and have very high shooting skills, you're going to accurately and precisely place rounds through arbitarily random portions of the enemy's ship, because you have no idea what you are actually doing, like an expert marksman shooting at an unknown alien: You can easily hit any portion of the alien you wish, but you have no idea which portion is actually important. Is that his head? Are his brains in there? Are those vital? You have no idea. A period of experimentation follows in which you precisely blow holes in parts of the enemy and observe how he reacts to having his whatzit shot off.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
But one thing I'm considering is not the actual damage the weapon has, it's the actual damage made to the ship.
For example if you shoot two times with your mass driver one hit may cause no harm to the ship because it penetrated the hull but there was nothing important there to be damaged, but the second shot may penetrate and cause some structural damage by hitting a sensitive part of the ship, even it does not hit a certain component.
I would think that in both cases, the damage caused would be about the same, except that in the first case, the damage is dealt to stuff that isn't important.

Then the question is what hit points am i showing? If I show the hit points of a ship that is equal to all it's parts then the damage of the weapon is always the same.
If I show you only the important part of the ship as hit points then it means that hitting something that isn't important will reduce less hit points than shooting something that is important.

With this in mind, considering a part of this damage is caused by the skill of the shooter then it would mean that if you're near your enemy you have more chance to make a good shot and if you're far you will probably hit but you can't be sure to cause the same amount of damage.
I'd think that, outside of range dissipation, the "chance of making a good shot", as I previously suggested, would be based on the fact that at closer range, the shot cone covers a smaller area of the target, making it more likely that the round actually happens to go where you want it to go. Of course, if you have no idea what you're doing, and have very high shooting skills, you're going to accurately and precisely place rounds through arbitarily random portions of the enemy's ship, because you have no idea what you are actually doing, like an expert marksman shooting at an unknown alien: You can easily hit any portion of the alien you wish, but you have no idea which portion is actually important. Is that his head? Are his brains in there? Are those vital? You have no idea. A period of experimentation follows in which you precisely blow holes in parts of the enemy and observe how he reacts to having his whatzit shot off.

That's true, I'm thinking of using the ship Radar to influence the damage too, where in it would reveal more and more of the enemy ship every turn, you would be able to more effectively use the bonus of shooting near it.
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
Then the question is what hit points am i showing? If I show the hit points of a ship that is equal to all it's parts then the damage of the weapon is always the same.
If I show you only the important part of the ship as hit points then it means that hitting something that isn't important will reduce less hit points than shooting something that is important.
That's a good question. Let me reply with another: Why are you showing hitpoints, anyway? Hitpoints seem like a rather archaic mechanic, implying that a thing spontaneously and suddenly undergoes total existence failure upon the loss of its final hitpoint. How many things actually behave like that? If a ship's hull is even considered to have "hitpoints", it would, realistically, just mean the kind of damage it would have to take all at once to be blown to bits instantly, vaporized, etc. If your ship is never hit with anything that is capable of doing that much damage, then, realistically, the thing would just remain intact indefinitely. Everyone's fond of the "space warships as naval warships" analogy, so let's look at some classic examples: The Hood and the Bismarck. The Hood basically just flat out exploded and broke in half. Total Existence Failure. What does this mean in game terms? Well, what we have is a hit, striking through the armor components, and destroying a Magazine Component, which was Made of Explodium. This component had a failure mode of "Explode Spectacularly, Inflicting Massive Damage", which was sufficient to do enough damage in a single blow to just rip the entire ship in half. Boom. Note how this didn't happen because of slow hitpoint attrition from being pounded by small shells. It happened because a component was damaged and failed catastrophically.

Now compare to the Bismarck itself: The Bismarck never actually exploded. It continued to be a battleship all the way to the end, well after every single combat-relevant component on it had been battered into worthless scrap. It was clearly toast, yet it still "there". They could have kept firing on it, continuing to inflict more damage, but why? It's dead. Every last weapon system is inoperable. Much of the crew is dead. It no longer functions as anything other than flaming scrap. It sank because the surviving crew decided to scuttle the ship, opening the sea valves and causing the thing to sink. You can't do that in space, so the ship is just going to drift there forever.

Basically, unless a weapon itself or a secondary effect of a component failing is enough to blow the ship apart, it just won't happen, even after the everything on the ship is worthless scrap. As a side benefit, the recognition that things can be "killed" without undergoing total existence failure also covers a relevant portion of the game: Looting. The undestroyed portion of a "dead" ship can be scavenged for components, while the destroyed portions can still be salvaged for scrap, whereas a tiny space fighter that has been converted to a rapidly expanding cloud of monatomic gas can't be looted. The "hitpoints" of the ship as a whole never needs to be displayed to the player, isn't really USEFUL to display to the player, and basically just defines the kind of damage that needs to be inflicted upon a section or the entire ship to reduce it instantly to an expanding cloud of debris, where you don't really care what about individual components, like a car being mashed by a train: The entire thing is instantly a pulverized mess of twisted metal, as opposed to a car being strafed by an airplane, where bullets penetrate individual pieces of the car, perforating wheels, engines, gas tanks, and passengers, but no realistic amount of shooting up that car with any number of planes is going to produce the same outcome that the train did.

That's true, I'm thinking of using the ship Radar to influence the damage too, where in it would reveal more and more of the enemy ship every turn, you would be able to more effectively use the bonus of shooting near it.
There wouldn't actually be a "bonus for shooting near it", other than that your targeting would be more accurate and your beams would suffer less range dissipation. Having functioning sensors would basically allow you to A: See what the hell is even there to be shot at in the first place, because if you can't see it you're basically just firing wildly into space, and B: Scan what it is you're shooting at, to identify where you should be shooting. A bullet fired by a drunken hobo that hits you in the head messes up your brainpan just as well as the same bullet fired by a sniper with a scope: It's just that the drunken hobo is far less likely to hit you by anything other than blind luck, reflected in the fact that the hobo's firing cone is a hell of a lot larger and includes a hell of a lot more non-brainpan and even non-you than the sniper's, and indeed, the hobo probably isn't even aware you're even in the firing cone at all.

So, a poor radar might be dimly aware that "Yeah, there's something over in that directionish", and see a kind of fuzzy blob of "possibly something theres", leaving the player to just kind of spray and pray, whereas a good radar return might indicate "there's definitely a thing, right there". The radar influences damage not directly by giving a bonus to damage, but by letting you shoot at something at all. But even the best and most accurate and precise sensor cannot help someone who displays blatant apathy and disinterest and prefers to just spray More Dakka in the general direction of the enemy.
 

Destroid

Arcane
Joined
May 9, 2007
Messages
16,628
Location
Australia
You can't really go too bananas on the tactical portion of a 4x or you will hurt the game - the tactical battles are the lesser component (usually), so you want them to have easy to understand rules and fast resolution.

That said, there are ways you can make hit points make sense. Say you have a force field or some sort of bonding field that holds your hull together. As you take hits, this field work to keep you intact, but either accumulates something (heat or whatever), or loses something (energy), and when you are full/empty, you ship is blown to pieces as the field overloads and can no longer help you. Likewise with sensors, you will be able to justify any game system you like with a little inventiveness.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Sorry, I said radar, but in reality it's a scanner. Each turn you finish, every enemy ship at your scanner range will get a token to indicate you know more about it than before, until it reaches 100%.

I'm going trough all this because attacks won't miss, as to make combat faster then the usual (miss miss miss miss hit miss miss), even if you adjust to have a high percentage it's still chance and I want to avoid it. So instead of player getting near the enemy to be able to shoot, it's must now get near the enemy to be able to shoot better.
It's mainly a game mechanic than wanting to imitate life.

Let me explain what I came up so far with hit points because this game is not the case of hit points zero means big explosion.

The hit points is the sum of all ships components hit points.
So if you have an engine with 10HP, an bridge with 5HP and a weapon with 8HP then your ship will have 23HP.
Why? Because the quality of your components means your ship will have a longer life span.
When hit the damage won't go directly to the ship HP, it will go to it's components even if you didn't aim at one.
(This is not implemented yet) The damage will be distributed equally among them, minus to components that were selected to be hidden, those would receive a smaller damage.
A component is made to disable itself after it reaches a amount of damage and to blow up or just stay idle after another amount of damage.

So if you keep hitting your enemy, unless you have bigger mean weapon that causes a lot of damage, your enemy ship will probably get disabled. If you are mean and aim at the engine you have a chance of blowing everything up instead of disabling it. And so on.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
You can't really go too bananas on the tactical portion of a 4x or you will hurt the game - the tactical battles are the lesser component (usually), so you want them to have easy to understand rules and fast resolution.

:bravo: M:
 

Norfleet

Moderator
Joined
Jun 3, 2005
Messages
12,250
You can't really go too bananas on the tactical portion of a 4x or you will hurt the game - the tactical battles are the lesser component (usually), so you want them to have easy to understand rules and fast resolution.
Well, any resolution is fairly fast when the computer handles it. I mean, the player probably isn't going to spend too much time fixating on it.

That said, there are ways you can make hit points make sense. Say you have a force field or some sort of bonding field that holds your hull together. As you take hits, this field work to keep you intact, but either accumulates something (heat or whatever), or loses something (energy), and when you are full/empty, you ship is blown to pieces as the field overloads and can no longer help you. Likewise with sensors, you will be able to justify any game system you like with a little inventiveness.
Well, sure, you can handwave everything, and just decide the combat isn't important and go with something really simple, sure.

But I disagree with the notion that tactical battles have to be the lesser component. It is easily possible to design the game such that tactical combats are relevant and important, rather than making the game boil down into unit spam. If ships are incredibly expensive, and represent an entire planet's worth of GDP to construct and operate, you're not going to see all that many ships, which makes the tactical combat important. It'll also make ships enormously huge and stuffed with a massive array of things to shoot up.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
But I disagree with the notion that tactical battles have to be the lesser component. It is easily possible to design the game such that tactical combats are relevant and important, rather than making the game boil down into unit spam. If ships are incredibly expensive, and represent an entire planet's worth of GDP to construct and operate, you're not going to see all that many ships, which makes the tactical combat important. It'll also make ships enormously huge and stuffed with a massive array of things to shoot up.

We just have to be careful to not fall in the situation "who builds first wins" that usually happens with expensive ships.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom