aliens

Author Topic: Battlescape development  (Read 290550 times)

Volutar

  • Guest
Re: Battlescape development
« Reply #105 on: February 23, 2011, 04:55:44 pm »
Unit elevation should be taken into account when checking LoS or LoF. I really haven't payed attention on what's the difference between originate coordinate setu pfor fire and for sight. It's not a problem of any kind and we really don't care how they did it. We should make it more "bugless" so to speak. And elevation should be taken into account for LoF and for LoS. There is some difficulty with LoS estimation for tiles on other levels (like visible roof of UFO) and we have to make some observations on how it works in original UFO.

Excuse me SupSuper, but here is screenshot of different "bullet" sprites. 11 visual types of it in original UFO, but we can expand it a little, with heavy plasma and plasma pistol longer or shorter trail, and so on.

/firesound / hitsound / hitanimation / weapon
 4 22 1 pistol
 4 22 1 rifle
12 13 1  heavy-cannon
12 13 1 auto-cannon
52 --  - rocket launcher
11 19 2 laser pistol
11 19 2 laser gun
11 19 2 heavy laser
36 --  - psi-amp
18 19 3 heavy plasma
18 19 3 plasma rifle
18 19 3 plasma pistol
53 -- 3 blaster launcher
53 -- -  small launcher

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #106 on: February 25, 2011, 02:19:43 pm »
In case people are trying the daily build, there currently is a bug in the colission detection or the loaded LOFTEMPS data...

edit-
For info:
I made the decision not to have the different LOFTEMP "slices" as different objects in the game engine, but to have a complete 16x16x24 voxel object as an object. So a voxel object (MapModel class) is created with 12 loftemp "slices" and then stored as a 3D model.
Each map object points to it's corresponding model. When loading a terrain a set of unique voxel models in that terrain is compiled. (I used a checksum/hash calculation on voxel data to easely compare voxel models)
As a result a terrain with 100 objects can have 20 models, because a model can be re-used for different objects.

The reason for this is not only because it's easier to work with complete models, but also that the loftemps slices method could -for some objects- be replaced with other, more detailed and complex, complete 16x16x24 models (or bigger). And then I'm especially thinking of units.
But for that a voxel model editor could come in handy :)
« Last Edit: February 25, 2011, 02:50:26 pm by Daiky »

Volutar

  • Guest
Re: Battlescape development
« Reply #107 on: February 25, 2011, 04:35:12 pm »
I wonder how are you going to store these voxel objects, either stacked bitmaps or as simple 3d array?
For 16x16x24 3d array will consume 6k of RAM, and stacked bmp will be only 768 bytes.
Considering low-memory ports like for Dingoo I really don't know how good that will be.

If you're hashing whole 3d voxel objects, why don't you hash each layer, for "optimizing" overall 3d object size for mapset?

I admit using solid 3d voxel objects is good idea, if we're aiming for more distinct 3d object representation and doubling resolution, but doubled resolution will be 8x of 3d size! 32x32x48 will be 48kbytes for each object as 3d array. And if there will be 256 of them - it will be 12mbytes!!! Stacked bitmaps will be 6k for single object and 1.5 mbytes for 256 objects.
If you'll make indexed LOFT links for 32x32x48 object (48 integers), it will be 192 bytes long and 48k for array of 256 objects, plus layer data (like original xcom has).

I think dynamically "built" LOFT objects from complete voxel objects (which will be stored in "new" object MCD) will be noticable less memory-consuming by cost of slight delay (probably couple of ms) at battlescape loading for dynamic LOFT table building and voxel objects compressing.
« Last Edit: February 25, 2011, 04:40:43 pm by Volutar »

Volutar

  • Guest
Re: Battlescape development
« Reply #108 on: February 26, 2011, 04:43:39 pm »
Top (on sand background) is original xcom. You can see trail is slightly longer, and there is THREE dots at the end, while BOTTOM is latest (Git build 2337) and there is only TWO dots. Also there is strange white dot in "fire" particle. I think you should recheck your data.
Bullet trail looks weird, like being teleporting throu some distance or dropping some of trail particles time to time.
« Last Edit: February 26, 2011, 04:49:00 pm by Volutar »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #109 on: February 28, 2011, 01:08:38 am »
Could you please give more info when you report a bug, like a screenshot in this case and system you are working on, and also report it in the bug report board? Thanks.
WinXP sp3
some screenshots: https://www.mediafire.com/?p7bx53qa59b3a81
usually day missions have this
Hi Yankes, I have located & fixed this bug. So if you take the latest build from the git builds page, you should not see this random black-tiles effect anymore.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #110 on: March 01, 2011, 11:03:55 am »
Hurray, I can striketrough some of my points.
- Got to finally implement the kneeling button.
- Adjust the bullet starting voxel depending on the stance.
- Line of fire collision detection !!!
- Determination of the target voxel.
- Applying firing accuracy.
- Different bullet sprites.
- Correct z-order of the bullet sprite.
- Bullet shadow.
- The impact damage.
- The impact visual effect.
- Sound effects.

Next thing to do is the impact damage, which is a rather essential part of shooting. You aint gonna kill alien bastards with blanks :)
« Last Edit: March 01, 2011, 11:06:01 am by Daiky »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Battlescape development
« Reply #111 on: March 01, 2011, 11:50:39 am »
Am i the only one to think that openxcom development accelerated recently? :) There are many new features in battlescape, also geoscape isn't worse (purchase, transfers) :)

If such rate will be maintaned i fell that openxcom will be playable (maybe not finished, but playable) in this year :D

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Battlescape development
« Reply #112 on: March 01, 2011, 12:05:55 pm »
Am i the only one to think that openxcom development accelerated recently? :) There are many new features in battlescape, also geoscape isn't worse (purchase, transfers) :)

If such rate will be maintaned i fell that openxcom will be playable (maybe not finished, but playable) in this year :D
AI will probably be the hardest feature, everything else is pretty direct. :)

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Battlescape development
« Reply #113 on: March 01, 2011, 12:09:49 pm »
Yeah, but even most stupid ai can give game a bit of playability and enjoyment ;)

For now, project is more a tech demo than actual game. When we will be able to finish mission (or die) it will became a game ;)

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Battlescape development
« Reply #114 on: March 01, 2011, 02:05:57 pm »
Yeah, but even most stupid ai can give game a bit of playability and enjoyment ;)

For now, project is more a tech demo than actual game. When we will be able to finish mission (or die) it will became a game ;)
Don't be silly, there is no finishing in X-Com, only death. :P

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #115 on: March 01, 2011, 02:23:39 pm »
I'm spending most of my free time on openxcom lately :) It's getting addictive.

Very simple AI can give pleasing results. Same as very complex AI can look stupid :) It's all about perception of the player.
You have two levels of AI: the group level and the unit level. And on these two levels you have a finite state machine.
The group levels on the geoscape seem to be zones on the world: "The North-Africa Group", and they are in state's we all know as "Harvest", "Abduction", "Terror" etc.
The unit levels on the geoscape are the UFO's. The are in state "exploring", "chasing", "fleeing", "going towards a base", "shot down".
The group level on the battlescape is just "aliens"... and sometimes "civilians". Depending on the mission the are in certain state: "attack civilians" or "explore" or "attack xcom" or "retreat".
The unit levels are the aliens, and have states "exploring", "chasing", "fleeing", "dead"....
The units each make decisions to stay in their current state or change state depending on all the input they get from "the world", some scripted stuff, some random stuff....
You could implement it like you did the game states. Each state it's own object.

One thing that I have read in some gamedev book, is that when a units changes state, it is interesting to show this as some kind of emotion to the player, and not just by it's behaviour. This really makes your units look intelligent. An example of this is, when a unit sees you and enters the "aggro-state", it screams. Or if it hears something, it turns it's head towards it... things like that.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #116 on: March 01, 2011, 03:23:25 pm »
Once you have all this nicely put into objects, you can make crazy combinations like:
After a civilian gets killed by an x-com soldier: set the "civilian group" into state "attack x-com".
And give civilians a melee attack with power 1 :p
"Hey wtf? Stop hitting me! We are on your side!"
« Last Edit: March 01, 2011, 03:25:59 pm by Daiky »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #117 on: March 01, 2011, 11:49:12 pm »
More good news!

Latest build: projectiles now affect terrain !

To play with I have given the first 3 units of the skyranger a heavy cannon, one with armor piercing ammo, one with heavy explosive and one with incendiary ammo.
Have fun!
Note that the AP ammo does not check object armor versus power - it has like unlimited power.
Also note that damage versus units is not yet implemented.

Weapons of mass destruction:

Volutar

  • Guest
Re: Battlescape development
« Reply #118 on: March 02, 2011, 09:34:00 am »
There is two minor fixes you should consider (1st if yours, and 2 is probably SupSuper's).

1) Energy numbers are slightly in wrong place, and should be shifted 1 pixel right.

2) There are two different modes for text drawing functions. Mode A - ordinary colored letters, when every font pixel value just added to font color - *screen=color+letter_val. And mode B (which is used for BattleScape) - when every font pixel value added with x3 value (so called high-contrast mode) - *screen=color+3*letter_val.
« Last Edit: March 02, 2011, 09:35:45 am by Volutar »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Battlescape development
« Reply #119 on: March 02, 2011, 11:34:29 am »
There is two minor fixes you should consider (1st if yours, and 2 is probably SupSuper's).

1) Energy numbers are slightly in wrong place, and should be shifted 1 pixel right.

2) There are two different modes for text drawing functions. Mode A - ordinary colored letters, when every font pixel value just added to font color - *screen=color+letter_val. And mode B (which is used for BattleScape) - when every font pixel value added with x3 value (so called high-contrast mode) - *screen=color+3*letter_val.
I think both are mine. :P And thanks, I knew the Battlescape text was drawn differently but I couldn't figure out exactly how.