Skip to content

Dice>Gizmo #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ab71d64
Add files via upload
hw1-5 Mar 19, 2018
d2db248
Added sparks, leaf, flynn
hw1-5 Mar 29, 2018
1fff561
stand alone .exe
hw1-5 Mar 31, 2018
0a0aa96
64bit ver.
hw1-5 Apr 22, 2018
d642375
64bit ver.
hw1-5 Apr 24, 2018
8fda8e6
ver. 3.0.1.4
hw1-5 May 17, 2018
69a9b99
Ver 3.0.1.7
nls0 Jul 22, 2018
eccde74
Added alias support for hero names
nls0 Jul 25, 2018
bb78ff1
Returned accidentally committed variable back to default
nls0 Jul 25, 2018
c8922c5
3.0.1.8
nls0 Jul 30, 2018
e3c817c
3.0.1.8b
nls0 Jul 30, 2018
1206ca8
3.0.1.8b
nls0 Jul 30, 2018
1b0242b
3.0.1.8b
nls0 Jul 30, 2018
84f6363
3.0.1.9
nls0 Aug 2, 2018
e21ae60
3.0.1.9b
nls0 Aug 3, 2018
bca6e2e
3.0.2.0
nls0 Aug 8, 2018
ce5d79e
3.0.2.0b
nls0 Aug 8, 2018
9a4fdef
3.0.2.0c
nls0 Aug 10, 2018
26901b8
3.0.2.0d
nls0 Aug 12, 2018
f37e222
3.0.2.0e
nls0 Aug 12, 2018
71ef50b
3.0.2.0f
nls0 Aug 12, 2018
668c0df
3.0.2.0g
nls0 Aug 12, 2018
747b1a5
3.0.7.1
nls0 Aug 21, 2018
8555f6a
3.0.7.1b
nls0 Aug 21, 2018
f01cc8a
3.0.7.1b
nls0 Aug 21, 2018
060eb17
3.0.8.0a
GizmoMar Sep 3, 2018
09d10f9
3.0.8.5a
GizmoMar Oct 1, 2018
9e81077
3.0.9.1a
GizmoMar Oct 8, 2018
70cf65f
3.0.9.1b
GizmoMar Oct 8, 2018
0366521
3.0.9.1b
GizmoMar Oct 8, 2018
38c14a4
3.0.9.1d
GizmoMar Oct 8, 2018
59472a6
3.0.9.1e
GizmoMar Oct 9, 2018
671af4d
3.0.9.1f
GizmoMar Oct 9, 2018
1e03b5b
3.0.9.1g
GizmoMar Oct 10, 2018
f4f076c
3.0.9.1g
GizmoMar Oct 10, 2018
8eeeb56
3.0.9.1h
GizmoMar Oct 10, 2018
3cb26cb
3.0.9.2a
GizmoMar Oct 15, 2018
d0fad25
3.1.0.1a
GizmoMar Oct 23, 2018
66afbcc
3.1.0.1b
GizmoMar Oct 24, 2018
f947027
3.1.1.1a
GizmoMar Oct 27, 2018
be0f473
3.1.1.1b
GizmoMar Oct 28, 2018
e7e04a2
3.1.1.1c
GizmoMar Oct 29, 2018
b9e0ecd
3.2.0.3a
GizmoMar Nov 8, 2018
7978f61
3.2.0.3b
GizmoMar Nov 8, 2018
b059ba0
remove PIERCE and its associated variable paoeDamage as james was cha…
zebulonmoderna Nov 17, 2018
ce038d0
add individualBattles to be set by INDIVIDUAL_BATTLES in config files
zebulonmoderna Nov 17, 2018
026e8fa
print replays for single battles (if otherwise so configured)
zebulonmoderna Nov 17, 2018
4c753f6
don't apply AOE to dead units
zebulonmoderna Nov 17, 2018
fddb2b0
take #2 at not applying ricochet damage to dead units
zebulonmoderna Nov 17, 2018
f1f328c
check to see if monster is frontliner so that damage from ricochet he…
zebulonmoderna Nov 18, 2018
334c282
damage now seems to be rounded
zebulonmoderna Nov 18, 2018
f0d2f72
increment version
zebulonmoderna Nov 18, 2018
4289c4a
fix Guy targeting
zebulonmoderna Nov 22, 2018
9c0c069
lux targetting maybe fixed (now issue with lux + lee)
zebulonmoderna Nov 23, 2018
4f9dc64
use Alya_N's fix for getTurnSeed and PokerFace - which maybe fixes Lu…
zebulonmoderna Nov 23, 2018
135c0fd
Lux targetting broken if hits more than once - hits dead unit in calc
zebulonmoderna Nov 23, 2018
f711871
getting closer to making Fawkes work - fix issues where calc applied …
zebulonmoderna Nov 25, 2018
93adb94
more seed fixes from alya_n
zebulonmoderna Nov 25, 2018
df0115b
hopefully make Lux not hit dead units
zebulonmoderna Nov 25, 2018
6b938f9
keep trying at Lux
zebulonmoderna Nov 25, 2018
6d8b661
Lux targetting continued; also handle interaction between Lee/Fawkes …
zebulonmoderna Nov 25, 2018
f0ff9ea
add SKIP_CONTINUE token to parser and skipContinue to config to allow…
zebulonmoderna Nov 25, 2018
08b3701
code cleanup - remove getNewTurnSeed - replaced by Alya_N's seed fixes
zebulonmoderna Nov 25, 2018
f7cbc77
Merge pull request #1 from zebulonmoderna/ricochet2
GizmoMar Nov 26, 2018
104a913
3.2.0.4d
GizmoMar Nov 26, 2018
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
Binary file modified CosmosQuest.exe
Binary file not shown.
132 changes: 132 additions & 0 deletions OLDREADME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Cosmos Quest PvE Instance Solver

## Summary
I took over the developement out of interest and educational purposes. Well, I also needed a good calculator and David's approach was a good place to start. My goal is to provide a Calculator that is usable even on difficult problems in respect to memory usage and calculation time.

Game forum and disscusuion thread [here](https://www.kongregate.com/forums/910715-cosmos-quest/topics/988381-version-2-9-1-merry-worldbosses).

Other Repos and Places you might find interesting:
* [Alternative Input throgh Latas' Graphical User Interface](https://github.com/Wiedmolol/CQMacroCreator)
* [Web-Based Macro File Creator](https://allions.net/macrocreator/)
* [Malizia's version of the Calc](https://github.com/Maliziacat/C-Hero-Calc)
* [Battle Specification and Hero Skill Explanations](https://www.kongregate.com/forums/910715-cosmos-quest/topics/959359-detailed-explanations-of-the-hero-abilities)

### Features
* C++ based Calcultor for solving PvE instances
* Heroes are implemented, levelable and skills are fully functional
* Completely controllable via Command Line or through external Macro Files
* All Quests predefined and accessable
* Worldboss Mode for maximising damage
* Specify multiple quests and let it work on them uninterupted
* Outputs a battle string that can be used to view the battle ingame from the Tournament Page
* Precompiled exe included (Built on Windows 8.1 (64Bit), no guarantee for other operating systems)

### What's New?
Bunch of Updates happend quietly in the background.
* Calc will now display its version to make it easier for me to determine if faulty interactions happend because of buggy code or due to a deprecated version being used
* I started to reintroduce some caching for fights to speed up the battles but generally the new code is still quite slow
* -1 as a lower limit no properly works and disables ALL normal Monsters
* **Worldbosses are added**. Having a worldboss in the enemy lineup (same input scheme as heroes) will make the calc enter worldboss mode and make it try to find the maximum damage
* **Ascended Heroes are added.** Names are a + original name. Example: Ascended Geror -> ageror:1
* **Christmas Heroes are added** including a Hero that will be available soon through the advent calendar

## Usage

For most people, just downloading the exe and running it will be enough. For those who are not on Windows they will need to download all files and compile for themselves.

### Input
**Inputting your heroes**:
Enter all of your heroes that you want the Calc to consider for a solution.

To enter a Hero type its name and a `:` followed by its level. Press enter to submit. (Example: `geror:23`)
Note: Hero names are always typed as one word, ignoring any special characters. (`Sîgrun` -> `sigrun`, `Jack'o Knight` -> `jackoknight`), Ascended Heroes are marked by an `a` in front of their name. (`Ascended Geror` -> `ageror`)

Once you have entered all your desired heroes you can either type `done` or press enter twice to finish.

**Entering a lower Follower Limit**:
This determines how expensive a monster needs to be in order for the calculator to consider it for a solution.
This feature is intended for users with a lot of followers or good heroes to ignore weak monsters.
Example: Entering `215000` will exclude `e8` and cheaper monsters in the solution.

Special Values are: `0` for ALL monsters considered and `-1` for NO monsters considered.

**Entering an upper Follower Limit**:
This determines how expensive the entire solution is allowed to be.
I only reluctantly put this option in because a lot of people asked for it. Note that as soon as calculation starts an upper bound is automatically generated by the Calc.
You can enter your followers here if you think that it speeds up calculation but then you won't be able to know how many followers you are missing to beat the lineup. Your choice.

Special Values are: `-1` for unlimited followers.

**Entering an enemy Lineup**:
Lineups are what you will modify most often. Input here the Fight against which you want to win.

You can enter normal monsters by combining their element (Fire -> f, Earth -> e, Air -> a, Water -> w) with their tier number.
Example: `Kodama` -> `a1`, `Kraken` -> `w7`

You can enter Heroes like you would your own.
You can enter Worldbosses just like Heroes.
If Units belong to the same Lineup they are separated with a `,`.
Full Example: `a13,geror:12,jackoknight:23,f2,groth:1,ladyoftwilight:1`

Alternatively you can enter quests by tying `quest`, the questnumber, a `-` and the difficulty in a range from `1` to `3`.
Example: `quest34-1` will make the Calc look for a solution to quest 34 with 6 monsters, `quest55-3` will make the Calc look for a solution for quest 55 with 4 monsters.

If you want to calculate a lot of lineups with the same settings you can do so by entering multiple lineups here and separating them with a space(` `). The Calc will then solve every lineup without stopping inbetween.

### Compiling
Personally I get it to compile by running:
`g++ -std=c++11 -Ofast -o CosmosQuest main.cpp inputProcessing.cpp cosmosData.cpp battleLogic.cpp base64.cpp` from the command line.

**Makefile**: Base Makefile provided by BugsyLansky.

### Macro Files

What are they?
Macro files are the future!
* Macro files are nothing else than your input in text file form.
* Whenever the Calc needs input it just grabs the next line from the macro file.
* When the last line of the marco file is used, the Calc switches back to manual input.
* A `//` makes the Calc ignore everything in the same line that comes after it.

If this is too much for you please refer to Latas' UI or the Web Editor that will automatically generate macro files.
If you do want to learn but still feel lost, here is a [Imgur Album](https://imgur.com/a/CXy4A) explaning how to make your own macro files.

How to use them? Multiple Options:
1. Start the program normally. It will take the `default.cqinput`-file as input
2. Start the program via command line like: `CosmosQuest.exe macroFile` instead of just `CosmosQuest.exe` and the program will read everything from the file you specified.
3. Compile yourself and add your own default macro file name. This will stop you having to start the program via command line.

### Input via command line
Input via command line is now mostly unavailable. Compiling yourself or removing `default.cqinput` from the folder will still give you access to it though.

### Control Variables
**If you want to use change any of those values you have to compile the program yourself!**
* `firstDominace` This controls at which army length the calc should start removing suboptimal solutions. Setting this higher _might_ improve the solution. But treat this with extreme caution as it can cause your PC run out of RAM rather quickly.
* `macroFileName` Path to your default macro file
* `useDefaultMacroFile` Whether you want to always use the specified macro file or not
* `showMacroFileInput` If enabled will hide any input promts that are answered by a macro file
* `showBattleReplayString` If disabled will hide the replay strings after every solution

## Bugs, Warnings and other problems

### Regarding non-optimal solutions
I feel like i need to put this up here because as many of you noticed, there are some situation where this calculator does in fact not give the optimal solution.
The reason for this is that old optimization code back from when this program was designed for only normal monsters is still in there and has bugs related to hero abilities. However this code is **absolutely vital** to keep the runtime of the program in managable regions.

On the user end, changing what heroes are enabled, what level they have, etc. can all affect the outcome of the calculation.
Even small changes that I make in the code can be the reason why on one day it might suddenly give a worse or better solution than before.
This is undesirable but will require heavy improvements on other ends or a completely new approach to fix.

### Regarding RAM usage
The RAM usage as well as computation time heavily scales with available Heroes and Monsters, so I reccomend disabling as many Heroes as possible and setting an appropriate lower limit on Monster Cost.
If you calculate a high DQ-Level you probably wont need those Lv.1 Commons or anything cheaper than monster tier 5 after all.
Having only 15 or 20 Heroes is totally fine but if you enable all of them, your machine will probably run out of RAM.

### Bugs that I'm aware of
No currently known unintended behaviours. Let me know if you find anything.

### Potential Errors:
**bad_alloc**: You get this error when the program tries to use more RAM than your computer has available.
There is no fix available for this, but I work hard to try and keep the general RAM usage to a minimum.

**The programm outputs: "FATAL ERROR"**: If this happens you should leave a comment in the forums because this is not normal behaviour.
Loading