这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0a93432
convert: Simple nyan struct implementation.
heinezen Aug 29, 2019
a22508a
convert: NyanMember sanity checks.
heinezen Aug 30, 2019
1afeef1
convert: NyanObject sanity checks.
heinezen Sep 1, 2019
ee51659
nyan-convert: More sanity checks and fqon setting.
heinezen Sep 2, 2019
23fa688
convert: Load nyan API.
heinezen Sep 4, 2019
6b84682
convert: CMakeLists adaption.
heinezen Sep 21, 2019
c3e8f41
convert: Converter pre-processor sceleton.
heinezen Sep 26, 2019
2e79e1d
convert: Genie conversion formats.
heinezen Oct 8, 2019
68473ee
convert: Lookup dicts for nyan object names.
heinezen Oct 9, 2019
36e986f
convert: Handle special unit lines.
heinezen Oct 11, 2019
aedd6d2
convert: Processor storage objects.
heinezen Oct 13, 2019
55bd817
convert: Fix older data reading bug.
heinezen Oct 14, 2019
df0ac2d
convert: Auxiliary support functions.
heinezen Oct 16, 2019
41bb693
convert: Rename Exportable class to GenieStructure.
heinezen Oct 17, 2019
e79eb7e
convert: define storage types for GenieStructure data format.
heinezen Oct 18, 2019
dd93d4e
convert: ArrayMember for storing values.
heinezen Oct 20, 2019
5bfbdac
convert: New Reader structure.
heinezen Oct 21, 2019
96520d9
convert: Data pre-processor.
heinezen Oct 23, 2019
bcec55e
convert: Process unit lines.
heinezen Oct 25, 2019
6dea8bd
convert: Fill converter groups.
heinezen Oct 28, 2019
7308d54
convert: Link creatables.
heinezen Nov 3, 2019
12890ff
nyan: implement nyan's "inf" value.
heinezen Nov 7, 2019
d93d757
convert: Remove self-updating logic from conversion objects.
heinezen Nov 7, 2019
2df6a57
convert: API pre-loading.
heinezen Nov 11, 2019
99d2a02
convert: Load engine.aux members.
heinezen Dec 20, 2019
2d620de
convert: Load engine.effect members.
heinezen Dec 22, 2019
ca298a5
convert: Load engine.resistance members.
heinezen Dec 22, 2019
f5e0d91
convert: Load engine.modifier members.
heinezen Dec 22, 2019
ecfee94
nyan: Implement ordered set for converter.
heinezen Dec 22, 2019
2f8eedf
convert: Expected pointers for resolving object dependencies.
heinezen Dec 25, 2019
22a04fa
convert: Bitfield value members.
heinezen Dec 31, 2019
6e448c2
convert: Assignment for inherited nyan members.
heinezen Jan 2, 2020
5979510
convert: nyan subprocessor preparation.
heinezen Jan 2, 2020
f5a6591
convert: 'Faith' attribute added to AoC.
heinezen Jan 7, 2020
bf92eef
convert: Built-in game entity types.
heinezen Jan 9, 2020
b2350a8
convert: Conversion for selected abilities.
heinezen Jan 12, 2020
b56fbda
convert: Move CombinedSprite definition and add mmber creation method…
heinezen Jan 14, 2020
be82229
convert: Resolve object and media dependencies.
heinezen Jan 14, 2020
0540d2f
convert: Bunch of codestyle fixes.
heinezen Jan 15, 2020
64b759c
convert: Move data definition to dedicated 'export' module.
heinezen Jan 18, 2020
13608ee
convert: Set fqon ob nyan objects in nyan file.
heinezen Jan 21, 2020
d8e3906
convert: Modpack definition file.
heinezen Jan 22, 2020
2d70c25
convert: Modpack container.
heinezen Jan 22, 2020
1e2bd36
convert: Organize nyan objects in nyan files.
heinezen Jan 22, 2020
7156b11
convert: Modpack export.
heinezen Jan 23, 2020
1e83cbf
convert: Find desired file location of sprite pointer.
heinezen Jan 23, 2020
72f6ece
convert: Round floats to 6 decimal places.
heinezen Jan 24, 2020
a4d4219
convert: Media export requests.
heinezen Jan 27, 2020
36068c5
convert: New version detection.
heinezen Jan 27, 2020
7f0125e
export: dotsprite and dotterrain
brisvag Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions doc/nyan/aoe2_nyan_tree.uxf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><diagram program="umlet" version="13.3">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="13.3">
<help_text>// Uncomment the following line to change the fontsize and font:
// fontsize=10
// fontfamily=SansSerif //possible: SansSerif,Serif,Monospaced
Expand Down Expand Up @@ -2737,7 +2738,7 @@ bg=blue</panel_attributes>
<x>3260</x>
<y>3490</y>
<w>240</w>
<h>90</h>
<h>80</h>
</coordinates>
<panel_attributes>*Progress*
bg=pink
Expand Down Expand Up @@ -2801,12 +2802,12 @@ bg=pink</panel_attributes>
<id>Relation</id>
<coordinates>
<x>3370</x>
<y>3570</y>
<y>3560</y>
<w>30</w>
<h>450</h>
<h>460</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;430.0</additional_attributes>
<additional_attributes>10.0;10.0;10.0;440.0</additional_attributes>
</element>
<element>
<id>Relation</id>
Expand Down Expand Up @@ -5734,7 +5735,7 @@ markup_file : file</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>1850</x>
<x>1840</x>
<y>1370</y>
<w>180</w>
<h>80</h>
Expand All @@ -5756,7 +5757,7 @@ sound : Sound</panel_attributes>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;.</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes>
<additional_attributes>10.0;10.0;10.0;60.0</additional_attributes>
</element>
<element>
<id>Relation</id>
Expand All @@ -5767,7 +5768,7 @@ sound : Sound</panel_attributes>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;.</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes>
<additional_attributes>10.0;10.0;10.0;60.0</additional_attributes>
</element>
<element>
<id>Relation</id>
Expand All @@ -5778,7 +5779,7 @@ sound : Sound</panel_attributes>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;.</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes>
<additional_attributes>10.0;10.0;10.0;60.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
Expand Down
4 changes: 3 additions & 1 deletion doc/nyan/api_reference/reference_ability.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Reference documentation of the `engine.ability` module of the openage modding AP

```python
Ability(Entity):
pass
```

Generalization object for all abilities. Abilities define what game entities can *do* and what they *are*, respectively. They can be considered passive and active traits.
Expand Down Expand Up @@ -116,7 +117,7 @@ Blacklist for specific game entities that would be covered by `allowed_types`, b

```python
ApplyDiscreteEffect(Ability):
effects : set(ContinuousEffect)
effects : set(DiscreteEffect)
reload_time : float
application_delay : float
allowed_types : set(GameEntityType)
Expand Down Expand Up @@ -220,6 +221,7 @@ A set of `DamageProgress` objects that can activate state changes and animation

```python
Deletable(Ability):
pass
```

Makes the game entity deletable via manual command. This will trigger the currently active `Die` ability without the need to fulfill the conditions for death. If the game entity does not have an active `Die` ability, the engine will try to trigger `Despawn` instead. If this ability is also not present, the game entity is instantly removed from the game.
Expand Down
26 changes: 17 additions & 9 deletions doc/nyan/api_reference/reference_aux.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Reference documentation of the `engine.aux` module of the openage modding API.

```python
Accuracy(Entity):
accuracy : float
accuracy_dispersion : float
dispersion_dropoff : DropOffType
target_types : set(GameEntityType)
accuracy : float
accuracy_dispersion : float
dispersion_dropoff : DropOffType
target_types : set(GameEntityType)
blacklisted_entities : set(GameEntity)
```

Stores information for the accuracy calculation of a game entity with `Projectile` ability.
<!-- Stores information for the accuracy calculation of a game entity with `Projectile` ability. -->

**accuracy**
The chance for the projectile to land at the "perfect" position to hit its target as a value between 0 and 1.
Expand Down Expand Up @@ -582,7 +582,7 @@ Subdivision of a formation. It defines the structure and placement of game entit
## aux.formation.PrecedingSubformation

```python
PrecedingSubformation(Entity):
PrecedingSubformation(Subformation):
precedes : Subformation
```

Expand Down Expand Up @@ -723,6 +723,14 @@ Defensive(GameEntityStance):

The game entity will use ranged abilities or move to the nearest target in its line of sight to use other abilities. If the target gets out of range or the line of sight, the game entity searches for a new target. When no new target can be found, the game entity returns to its original position and returns to an idle state.

## aux.game_entity_stance.type.Passive

```python
Passive(GameEntityStance):
```

The game entity will stay at its current position and only reacts to manual commands given by players. Abilities in `ability_preference` will be ignored.

## aux.game_entity_stance.type.StandGround

```python
Expand All @@ -731,13 +739,13 @@ StandGround(GameEntityStance):

The game entity will stay at its current position.

## aux.game_entity_stance.type.Passive
## aux.game_entity_type.GameEntityType

```python
Passive(GameEntityStance):
GameEntityType(Entity):
```

The game entity will stay at its current position and only reacts to manual commands given by players. Abilities in `ability_preference` will be ignored.
Classification for a game entity.

## aux.graphics.Animation

Expand Down
18 changes: 9 additions & 9 deletions libopenage/gamestate/game_spec.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2017 the openage authors. See copying.md for legal info.
// Copyright 2015-2020 the openage authors. See copying.md for legal info.

#include "game_spec.h"

Expand Down Expand Up @@ -195,8 +195,8 @@ void GameSpec::on_gamedata_loaded(const gamedata::empiresdat &gamedata) {

// create graphic id => graphic map
for (auto &graphic : gamedata.graphics.data) {
this->graphics[graphic.id] = &graphic;
this->slp_to_graphic[graphic.slp_id] = graphic.id;
this->graphics[graphic.graphic_id] = &graphic;
this->slp_to_graphic[graphic.slp_id] = graphic.graphic_id;
}

log::log(INFO << "Loading textures...");
Expand Down Expand Up @@ -249,7 +249,7 @@ void GameSpec::on_gamedata_loaded(const gamedata::empiresdat &gamedata) {

// create test sound objects that can be played later
this->available_sounds.insert({
sound.id,
sound.sound_id,
Sound{
this,
std::move(sound_items)
Expand Down Expand Up @@ -282,7 +282,7 @@ bool GameSpec::valid_graphic_id(index_t graphic_id) const {
void GameSpec::load_building(const gamedata::building_unit &building, unit_meta_list &list) const {

// check graphics
if (this->valid_graphic_id(building.graphic_standing0)) {
if (this->valid_graphic_id(building.idle_graphic0)) {
auto meta_type = std::make_shared<UnitTypeMeta>("Building", building.id0, [this, &building](const Player &owner) {
return std::make_shared<BuildingProducer>(owner, *this, &building);
});
Expand All @@ -294,8 +294,8 @@ void GameSpec::load_living(const gamedata::living_unit &unit, unit_meta_list &li

// check graphics
if (this->valid_graphic_id(unit.dying_graphic) &&
this->valid_graphic_id(unit.graphic_standing0) &&
this->valid_graphic_id(unit.walking_graphics0)) {
this->valid_graphic_id(unit.idle_graphic0) &&
this->valid_graphic_id(unit.move_graphics)) {
auto meta_type = std::make_shared<UnitTypeMeta>("Living", unit.id0, [this, &unit](const Player &owner) {
return std::make_shared<LivingProducer>(owner, *this, &unit);
});
Expand All @@ -306,7 +306,7 @@ void GameSpec::load_living(const gamedata::living_unit &unit, unit_meta_list &li
void GameSpec::load_object(const gamedata::unit_object &object, unit_meta_list &list) const {

// check graphics
if (this->valid_graphic_id(object.graphic_standing0)) {
if (this->valid_graphic_id(object.idle_graphic0)) {
auto meta_type = std::make_shared<UnitTypeMeta>("Object", object.id0, [this, &object](const Player &owner) {
return std::make_shared<ObjectProducer>(owner, *this, &object);
});
Expand All @@ -317,7 +317,7 @@ void GameSpec::load_object(const gamedata::unit_object &object, unit_meta_list &
void GameSpec::load_missile(const gamedata::missile_unit &proj, unit_meta_list &list) const {

// check graphics
if (this->valid_graphic_id(proj.graphic_standing0)) {
if (this->valid_graphic_id(proj.idle_graphic0)) {
auto meta_type = std::make_shared<UnitTypeMeta>("Projectile", proj.id0, [this, &proj](const Player &owner) {
return std::make_shared<ProjectileProducer>(owner, *this, &proj);
});
Expand Down
28 changes: 14 additions & 14 deletions libopenage/unit/producer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014-2019 the openage authors. See copying.md for legal info.
// Copyright 2014-2020 the openage authors. See copying.md for legal info.

#include <initializer_list>

Expand Down Expand Up @@ -92,7 +92,7 @@ ObjectProducer::ObjectProducer(const Player &owner, const GameSpec &spec, const
dataspec(spec),
unit_data(*ud),
terrain_outline{nullptr},
default_tex{spec.get_unit_texture(ud->graphic_standing0)},
default_tex{spec.get_unit_texture(ud->idle_graphic0)},
dead_unit_id{ud->dead_unit_id} {

// copy the class type
Expand Down Expand Up @@ -124,15 +124,15 @@ ObjectProducer::ObjectProducer(const Player &owner, const GameSpec &spec, const
};

// shape of the outline
if (this->unit_data.selection_shape > 1) {
if (this->unit_data.obstruction_class > 1) {
this->terrain_outline = radial_outline(this->unit_data.radius_x);
}
else {
this->terrain_outline = square_outline(this->foundation_size);
}

// graphic set
auto standing = spec.get_unit_texture(this->unit_data.graphic_standing0);
auto standing = spec.get_unit_texture(this->unit_data.idle_graphic0);
if (!standing) {

// indicates problems with data converion
Expand Down Expand Up @@ -247,7 +247,7 @@ void ObjectProducer::initialise(Unit *unit, Player &player) {
else if (this->unit_data.unit_class == gamedata::unit_classes::PREY_ANIMAL) {
unit->add_attribute(std::make_shared<Attribute<attr_type::resource>>(game_resource::food, 140));
}
else if (this->unit_data.unit_class == gamedata::unit_classes::SHEEP) {
else if (this->unit_data.unit_class == gamedata::unit_classes::HERDABLE) {
unit->add_attribute(std::make_shared<Attribute<attr_type::resource>>(game_resource::food, 100, 0.1));
}
else if (this->unit_data.unit_class == gamedata::unit_classes::GOLD_MINE) {
Expand Down Expand Up @@ -295,7 +295,7 @@ void ObjectProducer::initialise(Unit *unit, Player &player) {
TerrainObject *ObjectProducer::place(Unit *u, std::shared_ptr<Terrain> terrain, coord::phys3 init_pos) const {

// create new object with correct base shape
if (this->unit_data.selection_shape > 1) {
if (this->unit_data.obstruction_class > 1) {
u->make_location<RadialObject>(this->unit_data.radius_x, this->terrain_outline);
}
else {
Expand Down Expand Up @@ -372,7 +372,7 @@ MovableProducer::MovableProducer(const Player &owner, const GameSpec &spec, cons
// extra graphics if available
// villagers have invalid attack and walk graphics
// it seems these come from the command data instead
auto walk = spec.get_unit_texture(this->unit_data.walking_graphics0);
auto walk = spec.get_unit_texture(this->unit_data.move_graphics);
if (!walk) {

// use standing instead
Expand Down Expand Up @@ -455,7 +455,7 @@ void LivingProducer::initialise(Unit *unit, Player &player) {
MovableProducer::initialise(unit, player);

// population of 1 for all movable units
if (this->unit_data.unit_class != gamedata::unit_classes::SHEEP) {
if (this->unit_data.unit_class != gamedata::unit_classes::HERDABLE) {
unit->add_attribute(std::make_shared<Attribute<attr_type::population>>(1, 0));
}

Expand All @@ -482,7 +482,7 @@ void LivingProducer::initialise(Unit *unit, Player &player) {
multitype_attr.types[gamedata::unit_classes::CIVILIAN] = this->parent_type(); // get default villager
multitype_attr.types[gamedata::unit_classes::BUILDING] = this->owner.get_type(156); // builder 118
multitype_attr.types[gamedata::unit_classes::BERRY_BUSH] = this->owner.get_type(120); // forager
multitype_attr.types[gamedata::unit_classes::SHEEP] = this->owner.get_type(592); // sheperd
multitype_attr.types[gamedata::unit_classes::HERDABLE] = this->owner.get_type(592); // sheperd
multitype_attr.types[gamedata::unit_classes::TREES] = this->owner.get_type(123); // woodcutter
multitype_attr.types[gamedata::unit_classes::GOLD_MINE] = this->owner.get_type(579); // gold miner
multitype_attr.types[gamedata::unit_classes::STONE_MINE] = this->owner.get_type(124); // stone miner
Expand All @@ -494,7 +494,7 @@ void LivingProducer::initialise(Unit *unit, Player &player) {
multitype_attr.types[gamedata::unit_classes::CIVILIAN] = this->parent_type(); // get default villager
multitype_attr.types[gamedata::unit_classes::BUILDING] = this->owner.get_type(222); // builder 212
multitype_attr.types[gamedata::unit_classes::BERRY_BUSH] = this->owner.get_type(354); // forager
multitype_attr.types[gamedata::unit_classes::SHEEP] = this->owner.get_type(590); // sheperd
multitype_attr.types[gamedata::unit_classes::HERDABLE] = this->owner.get_type(590); // sheperd
multitype_attr.types[gamedata::unit_classes::TREES] = this->owner.get_type(218); // woodcutter
multitype_attr.types[gamedata::unit_classes::GOLD_MINE] = this->owner.get_type(581); // gold miner
multitype_attr.types[gamedata::unit_classes::STONE_MINE] = this->owner.get_type(220); // stone miner
Expand Down Expand Up @@ -524,7 +524,7 @@ BuildingProducer::BuildingProducer(const Player &owner, const GameSpec &spec, co
:
UnitType(owner),
unit_data{*ud},
texture{spec.get_unit_texture(ud->graphic_standing0)},
texture{spec.get_unit_texture(ud->idle_graphic0)},
destroyed{spec.get_unit_texture(ud->dying_graphic)},
projectile{this->unit_data.missile_unit_id},
foundation_terrain{ud->foundation_terrain_id},
Expand Down Expand Up @@ -557,8 +557,8 @@ BuildingProducer::BuildingProducer(const Player &owner, const GameSpec &spec, co

// graphic set
this->graphics[graphic_type::construct] = spec.get_unit_texture(ud->construction_graphic_id);
this->graphics[graphic_type::standing] = spec.get_unit_texture(ud->graphic_standing0);
this->graphics[graphic_type::attack] = spec.get_unit_texture(ud->graphic_standing0);
this->graphics[graphic_type::standing] = spec.get_unit_texture(ud->idle_graphic0);
this->graphics[graphic_type::attack] = spec.get_unit_texture(ud->idle_graphic0);
auto dying_tex = spec.get_unit_texture(ud->dying_graphic);
if (dying_tex) {
this->graphics[graphic_type::dying] = dying_tex;
Expand Down Expand Up @@ -793,7 +793,7 @@ ProjectileProducer::ProjectileProducer(const Player &owner, const GameSpec &spec
:
UnitType(owner),
unit_data{*pd},
tex{spec.get_unit_texture(this->unit_data.graphic_standing0)},
tex{spec.get_unit_texture(this->unit_data.idle_graphic0)},
sh{spec.get_unit_texture(3379)}, // 3379 = general arrow shadow
destroyed{spec.get_unit_texture(this->unit_data.dying_graphic)} {

Expand Down
4 changes: 2 additions & 2 deletions libopenage/unit/unit_texture.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2018 the openage authors. See copying.md for legal info.
// Copyright 2015-2020 the openage authors. See copying.md for legal info.

#include "unit_texture.h"

Expand All @@ -22,7 +22,7 @@ UnitTexture::UnitTexture(GameSpec &spec, uint16_t graphic_id, bool delta)

UnitTexture::UnitTexture(GameSpec &spec, const gamedata::graphic *graphic, bool delta)
:
id{graphic->id},
id{graphic->graphic_id},
sound_id{graphic->sound_id},
frame_count{graphic->frame_count},
angle_count{graphic->angle_count},
Expand Down
1 change: 1 addition & 0 deletions openage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ add_subdirectory(cvar)
add_subdirectory(event)
add_subdirectory(game)
add_subdirectory(log)
add_subdirectory(nyan)
add_subdirectory(util)
add_subdirectory(renderer)
add_subdirectory(testing)
2 changes: 1 addition & 1 deletion openage/codegen/gamespec_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gamespec struct code generation listing.
"""

from ..convert.dataformat.data_formatter import DataFormatter
from ..convert.export.data_formatter import DataFormatter

from ..convert.dataformat.multisubtype_base import MultisubtypeBaseFile
from ..convert.gamedata.empiresdat import EmpiresDat
Expand Down
3 changes: 3 additions & 0 deletions openage/convert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ add_pxds(
)

add_subdirectory(dataformat)
add_subdirectory(export)
add_subdirectory(gamedata)
add_subdirectory(hardcoded)
add_subdirectory(interface)
add_subdirectory(nyan)
add_subdirectory(opus)
add_subdirectory(processor)
Loading