Research State Loader¶
Main work is done in ResearchesDataHandler class. It is responsible for deserializing researches data from server messages into client components.
Data comes from * https://github.com/bytro/client-api-json-schema/wiki/ClientResearchState
ultshared.UltResearchState¶
We read the ultshared.research.UltResearchType
and create an Entity that contains the research data.
* ResearchSlots component Contains the research slots data.
* ResearchQueueMaxLength component Contains the research queue length data.
* CompletedResearches component Contains the completed researches data.
* CurrentResearch component Contains the current research data.
* QueuedResearches component Contains the queued researches data.
* PossibleResearchesRef component Contains the possible researches data stored in individual entities.
PossibleResearches¶
Possible Researches are split into multiple Entities as they contain extra nested data, like costs, requirements, etc. Each entity represents the https://github.com/bytro/client-api-json-schema/wiki/ClientResearchType
- PossibleResearches component contains all the plain data that are not arrays
- PossibleResearchesCosts component contains the costs data
- PossibleResearchesFactions component contains the factions data
- PossibleResearchesRequiredResearches component contains the required researches data
- PossibleResearchesStringOptions component contains the string options data
- PossibleResearchesRequiredPlans component contains the required plans data
More info on: https://github.com/bytro/engine-documentation/blob/main/docs/Manual/Game%20Features/research.md
Example data sent by server¶
{
"@c": "ultshared.UltResearchState",
"stateType": 23,
"stateID": "102125276284503",
"timeStamp": "1713982022668",
"researchSlots": 2,
"researchQueueMaxLength": 0,
"currentResearches": [
{
"@c": "ultshared.research.UltResearch",
"researchTypeID": 9314,
"startTime": 1713981997053,
"endTime": 1714010797053,
"speedUp": 0
},
{
"@c": "ultshared.research.UltResearch",
"researchTypeID": 9348,
"startTime": 1713982008804,
"endTime": 1713983808804,
"speedUp": 0
}
],
"completedResearches": {
"9313": {
"@c": "ultshared.research.UltResearch",
"researchTypeID": 9313,
"startTime": 1713980161932,
"endTime": 1713981961913,
"speedUp": 1
},
"9390": {
"@c": "ultshared.research.UltResearch",
"researchTypeID": 9390,
"startTime": 1713953156163,
"endTime": 1713981956142,
"speedUp": 1
},
"9462": {
"@c": "ultshared.research.UltResearch",
"researchTypeID": 9462,
"startTime": 0,
"endTime": 0,
"speedUp": 0
}
},
"possibleResearches": {
"9300": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9300,
"identifier": "",
"set": 4,
"setOrderID": 5,
"costs": {
"1": 1300,
"4": 2650,
"5": 1300,
"20": 5750
},
"buildTime": 28800,
"dayAvailable": 3,
"replacedResearch": 0,
"aiResearchFactor": 0.10000000149011612,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 20,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 259200000,
"name": "Aircraft Carrier",
"desc": "",
"factionBaseItemID": {
"identifier": 1034
},
"factions": [
1
]
},
"9307": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9307,
"identifier": "",
"set": 7,
"setOrderID": 4,
"costs": {
"1": 750,
"2": 1600,
"4": 200,
"20": 2500
},
"buildTime": 1800,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 1.5,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 11,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Anti Air",
"desc": "",
"factionBaseItemID": {
"identifier": 983
},
"factions": [
1
]
},
"9319": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9319,
"identifier": "",
"set": 2,
"setOrderID": 1,
"costs": {
"2": 1000,
"4": 1450,
"5": 1200,
"20": 5250
},
"buildTime": 1800,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 2.799999952316284,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 5,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Armored Car",
"desc": "",
"factionBaseItemID": {
"identifier": 957
},
"factions": [
1
]
},
"9324": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9324,
"identifier": "",
"set": 7,
"setOrderID": 2,
"costs": {
"1": 1100,
"2": 2550,
"4": 600,
"20": 4650
},
"buildTime": 9000,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 2.4000000953674316,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 10,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Artillery",
"desc": "",
"factionBaseItemID": {
"identifier": 978
},
"factions": [
1
]
},
"9333": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9333,
"identifier": "",
"set": 4,
"setOrderID": 4,
"costs": {
"1": 2200,
"4": 2900,
"5": 1450,
"20": 7050
},
"buildTime": 39600,
"dayAvailable": 2,
"replacedResearch": 0,
"aiResearchFactor": 1,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 19,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 172800000,
"name": "Battleship",
"desc": "",
"factionBaseItemID": {
"identifier": 1028
},
"factions": [
1
]
},
"9342": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9342,
"identifier": "",
"set": 4,
"setOrderID": 3,
"costs": {
"1": 1250,
"4": 1850,
"5": 1250,
"20": 5350
},
"buildTime": 9000,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.800000011920929,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 18,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Cruiser",
"desc": "",
"factionBaseItemID": {
"identifier": 1022
},
"factions": [
1
]
},
"9354": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9354,
"identifier": "",
"set": 5,
"setOrderID": 4,
"costs": {
"4": 350,
"5": 450,
"6": 1150,
"20": 2450
},
"buildTime": 28800,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.20000000298023224,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 37,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Flying Bomb",
"desc": "",
"factionBaseItemID": {
"identifier": 1044
},
"factions": [
1
]
},
"9359": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9359,
"identifier": "",
"set": 1,
"setOrderID": 2,
"costs": {
"1": 1850,
"2": 850,
"20": 2500
},
"buildTime": 1800,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 3.200000047683716,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 12,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Infantry",
"desc": "",
"factionBaseItemID": {
"identifier": 988
},
"factions": [
1
]
},
"9366": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9366,
"identifier": "",
"set": 3,
"setOrderID": 1,
"costs": {
"2": 1000,
"5": 1000,
"6": 1500,
"20": 4250
},
"buildTime": 9000,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.4000000059604645,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 1,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Interceptor",
"desc": "",
"factionBaseItemID": {
"identifier": 933
},
"factions": [
1
]
},
"9399": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9399,
"identifier": "",
"set": 3,
"setOrderID": 5,
"costs": {
"2": 1000,
"5": 1000,
"6": 1500,
"20": 4250
},
"buildTime": 1800,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.20000000298023224,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 4,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Naval Bomber",
"desc": "",
"factionBaseItemID": {
"identifier": 951
},
"factions": [
1
]
},
"9418": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9418,
"identifier": "",
"set": 5,
"setOrderID": 3,
"costs": {
"4": 4950,
"5": 3950,
"6": 3950,
"20": 13750
},
"buildTime": 86400,
"dayAvailable": 3,
"replacedResearch": 0,
"aiResearchFactor": 3,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 28,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 259200000,
"name": "Railroad Gun",
"desc": "",
"factionBaseItemID": {
"identifier": 1052
},
"factions": [
1
]
},
"9435": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9435,
"identifier": "",
"set": 3,
"setOrderID": 4,
"costs": {
"2": 1650,
"5": 1650,
"6": 3300,
"20": 7150
},
"buildTime": 39600,
"dayAvailable": 2,
"replacedResearch": 0,
"aiResearchFactor": 0.699999988079071,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 3,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 172800000,
"name": "Strategic Bomber",
"desc": "",
"factionBaseItemID": {
"identifier": 945
},
"factions": [
1
]
},
"9442": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9442,
"identifier": "",
"set": 4,
"setOrderID": 2,
"costs": {
"1": 1100,
"4": 1100,
"5": 1100,
"20": 4600
},
"buildTime": 9000,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.6000000238418579,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 17,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Submarine",
"desc": "",
"factionBaseItemID": {
"identifier": 1016
},
"factions": [
1
]
},
"9448": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9448,
"identifier": "",
"set": 3,
"setOrderID": 2,
"costs": {
"2": 1450,
"5": 1450,
"6": 2900,
"20": 6350
},
"buildTime": 39600,
"dayAvailable": 2,
"replacedResearch": 0,
"aiResearchFactor": 0.5,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 2,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 172800000,
"name": "Tactical Bomber",
"desc": "",
"factionBaseItemID": {
"identifier": 939
},
"factions": [
1
]
},
"9463": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9463,
"identifier": "",
"set": 4,
"setOrderID": 6,
"costs": {
"1": 1750,
"4": 1750,
"5": 750,
"20": 3000
},
"buildTime": 28800,
"dayAvailable": 3,
"replacedResearch": 9462,
"aiResearchFactor": 2.4000000953674316,
"requiredResearches": {
"9462": 0
},
"requiredPlans": {},
"trackingOptionID": 35,
"transportShipResearch": true,
"stringOptions": {
"transportShip": "1"
},
"tier": 2,
"minResearchSpeedUpTime": 259200000,
"name": "Transport Ship",
"desc": "",
"factionBaseItemID": {
"identifier": 4645
},
"factions": [
1
]
},
"9466": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9466,
"identifier": "",
"set": 3,
"setOrderID": 3,
"costs": {
"2": 1200,
"5": 1200,
"6": 2350,
"20": 5150
},
"buildTime": 50400,
"dayAvailable": 1,
"replacedResearch": 0,
"aiResearchFactor": 0.4000000059604645,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 38,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 86400000,
"name": "Attack Bomber",
"desc": "",
"factionBaseItemID": {
"identifier": 4789
},
"factions": [
1
]
},
"9471": {
"@c": "ultshared.research.UltResearchType",
"itemID": 9471,
"identifier": "",
"set": 5,
"setOrderID": 1,
"costs": {
"1": 1500,
"4": 650,
"6": 2450,
"20": 5750
},
"buildTime": 61200,
"dayAvailable": 2,
"replacedResearch": 0,
"aiResearchFactor": 2.799999952316284,
"requiredResearches": {},
"requiredPlans": {},
"trackingOptionID": 39,
"transportShipResearch": false,
"stringOptions": {},
"tier": 1,
"minResearchSpeedUpTime": 172800000,
"name": "Rocket Artillery",
"desc": "",
"factionBaseItemID": {
"identifier": 4794
},
"factions": [
1
]
}
},
"queueableResearches": {}
}