Outpost Universe Forums

Off Topic => General Interest => Game Discussion General => Topic started by: lordpalandus on March 11, 2018, 02:07:11 AM

Title: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on March 11, 2018, 02:07:11 AM
This is the eleventh Alpha release. I have not heard anything from GOG yet, and have sent them this update as well.

This was primarily a heavy refactoring release, cleaning up the code base, removing unnecessary redundancy, and fixing a few minor bugs that I missed in the Alpha 10. This release also includes Profiles, which allows for progress across playthroughs. Can see what things are transferred between games by checking out Profile Info (Shift + P); Mass Drop is now Shift + R.

Major Highlights:
- Heavy refactoring of the codebase, which makes the codebase easier for me to work with and find things easier.
- Fixed a few bugs I found that I had missed in Alpha 10's release.
- Created a "Turn-Script" function, that performs all the code that should be run each turn. In the future, I might be able to use this to create Buff/Debuffs.
- Created a Profile Infomration screen, Shift + P.
- Created Profiles; progress across playthroughs.
- Modified the main interface, character information and profile information menus a bit.
- Added in a few new ways to train attributes and skill masteries.
- Created a text-input interface, that currently allows the player to choose their name.

=======================

Implemented for next release, Alpha V12:

Nearly Complete Features:
1. Crafting and Runic Shard Scavenging (Only now need to create Artifact Recipes...)
2. Map Generation Overhaul
3. Biomes and Effects
4. UI Overhaul
5. The Chaos God and You
6. Tutorial and Help Directory
7. Win Conditions and Quick & Enjoyable Playthrus
8. Profiles and Profile Updating
9. Player Input Interface (ie Enter your Name or Craft X Items)

Partially Implemented:
1. Heavy Code Cleanup and Redundancy Improvements
2. Code Modularization and Separate Files
3. Redesigned Inventory and Satchel
4. Artifact Equipment
5. Sanity Mechanics (ie Hallucinations)
6. Grades of Field of View
7. Stacking Consumables in Satchel
8. Legendary Runes
9. Game Endings
10. Game Story

Maybe Cancelled:
1. Hunters (replaced with Treasure Fiends)
2. Monster Abilities (replaced with Modifiers)
3. Debuffs (replaced with More Intelligent AI)

------------

Features Needed to reach Beta / Early Access (ermm, well, unpaid Early Access at least):

1. Testing Code with Temporary Sprites (to ensure a smooth transition to sprite/tiled visuals)
2. Testing Code with Temporary Sounds/Music (to ensure a smooth transition from silence, to audible)
3. Journals, Journal Entries, and Overall Lore
4. Options and Pause Menu
========================

Link to grab Binary build (too big for upload here) = http://www.mediafire.com/file/62s8v2jog29x9vd/BinaryV11.zip
Title: Re: Cataclysm of Chaos, Remade (ASCII), Alpha V11
Post by: lordpalandus on March 11, 2018, 02:08:04 AM
Now that I have officially reached Alpha Status, I will now start putting together a few long-term goals that will likely take me more than a week to accomplish.
===========================
Long-Term Task List:

-> [NEARLY DONE] Map Generation Improvements: (Crystal Clumps, Random Environmental Features, Eventually code to handle Biomes, etc...)

-> [WIP] Code Redesign, Modularization, and Code Documentation: (Consistent Naming Schemes [ie Function Names, Class Names...], Code Redundancy Removal, Remove Prototyped Code and Replace with Finalized Code, Use a Consistent Theme with Comments, Use Doc Strings effectively, etc...) 

-> [HALFWAY DONE] Type Systems; Instead of many small functions, using the same code, introduce a Type system, that determines which block of code to implement. I already have a Type system in place for Monster and Loot Generation, and I find that a lot of my other code could benefit from a Type System.

-> [WIP] Endgame Content: (Artifacts, Legendary Runes, Legendary Skill Masteries, Bosses, Victory Conditions, etc...)

-> [NEARLY DONE] Finish off Python Tutorial = I still need to do Input/output Formatting and Exceptions, but they aren't a huge current priority.

-> [HALFWAY DONE] Address interface related issues (Double Windows, Menu issues, Sorting Inventories, learning libtcodpy console functions, Menus stay open, etc)

=============================

This Week's Task List for Alpha V12: (Will continue to work on #1-5 this this coming week)

1. [WIP] Replace large nested if-else statements with function calls, in particular for combat code.
2. [WIP] Try to refactor a lot of the code, and then send large chunks of it into separate modules, to shrink the size of the main file.
3. Clean up unnecessary comments and build in documentation strings where needed.
4. Try to keep code that I don't want the user ever to have access to within, a specific compiled file; whether it is the main file or a secondary file.
5. Redesign how I store large quantities of variables; instead of invidividual global variables, maybe have some more lists or utilize dictionaries.
6. Add numerical input system to crafting items, so that you can batch craft a specific item, X number of times.
7. Look into Stacking Consumables in the Satchel.
8. Look into Colored Menus for the various interfaces.
9. Look into Creating Legendary Runes.
10. Look into Finishing off some of the Longterm Goals, Above. That way I can consider them done and move onto new ones!
Title: Re: Chaotic Planar Prison
Post by: Hooman on March 14, 2018, 07:52:38 PM
Good to hear about the progress on your new project.

For the break issue, do you have a doubly nested loop? I so, the break will only exit the closest inner loop. If you need to break further out, sometimes return can be useful.
Title: Re: Chaotic Planar Prison
Post by: lordpalandus on March 15, 2018, 12:43:28 AM
Well, it turned out that the main menu, that appears at every game startup, doesn't deactivate after running the code. Thus, hitting escape, breaks the main event loop, but brings you back to the Main Menu, which is why you either have to hit c to quit or begin anew.

I added an additional break after the function call for playgame(), so that when the main event loop (playgame) is broken, then the main menu will also break, allowing the program to end.

I'll look into provide an actual pause menu later, but for now this is sufficient.
Title: Re: Chaotic Planar Prison
Post by: Vagabond on March 15, 2018, 10:12:09 AM
Glad to hear you are making some good progress. Will be interested to see where you go with the project.

I keep hearing good things about Python but have never used the language myself.

-Brett
Title: Re: Chaotic Planar Prison
Post by: lordpalandus on March 15, 2018, 12:21:43 PM
Well Python does have two unique features that I've not seen in other languages:

1. Instead of using { } to create blocks of code, you use tabs or 4 space indentations. You have to choose one of them and the other becomes a syntax error, if you accidentally put it in your code.

2. Python is both an interpreted and compiled language. It compiles any secondary file imports but interprets the primary file. It however does sound like you can compile the main file into a binary .exe file. (Or it compiles all files into a binary, unsure of that).

EDIT: After a ton of work, I figured out ways to address tasks #3 and #5, and thus they are either fully solved or temporarily solved now. A few more things to do on the task list, before I can update it with new tasks.

EDIT2: After a lot of frustration and confusion, I have working mouse support for menus. I had to add a variety of additional code to the program, that the tutorial didn't mention to get it to work, that feels like code duplication, but oh well. I don't fully understand why it works right now, but it works fully, so I'll just figure out why it works later, when I go to create my own menus / redesign the current ones.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: lordpalandus on March 17, 2018, 05:09:32 PM
Released V2 of the Prototype, a day early. Created a Changelog that lists all of the things I accomplished this week, and have updated the Readme with new controls and other notes.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: Hooman on March 18, 2018, 03:21:22 AM
Hey, based on the zip file, it seems like you're programming this one straight from a simple text editor, rather than using any kind of code generating interface. Is that correct?

Have you thought about hosting the source code on GitHub? I can give you a quick intro if you want to do a pair programming session.

Title: Re: Chaotic Planar Prison - Prototype V2
Post by: lordpalandus on March 18, 2018, 10:27:41 AM
Yes I am coding it straight from Notepad++ at the moment. Though I might choose an IDE later once I start running into logic or runtime errors that I cannot solve.

I wasn't planning on putting up the source on github. As I intend to market this one, it will be closed source, and just because right now I'm distributing the source files doesn't mean I want to do that permanently. Over time, I intend to break up the codebase into separate files, and then I'll be distributing them as compiled pyc files or as a binary and dlls. I might include some files in an uncompiled state for modding purposes, but the current situation of the source being able to be looked through is temporary.

Thanks for the offer, but I'll pass.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: Hooman on March 18, 2018, 09:43:05 PM
Notepad++ is great. For a language like Python, you could do just fine using only that. I mostly stopped caring about having an IDE when I started using Notepad++ for Ruby work.


I can understand the concern about not wanting to put up source code for a commercial project. Very few people put up the code for something they are charging for.

I suppose you can always use one of the GitHub alternatives that allows for free private Git repositories:
GitLab (https://gitlab.com/)
Bitbucket (https://bitbucket.org/)




On a related note, here's some food for thought:
Gratis versus Libre (https://en.wikipedia.org/wiki/Gratis_versus_libre)

Cost, source code access, and even redistribution rights are rather independent concepts. All independently under the control of the original author. At least as far as legal protections go. There's still the issue of piracy though, which is possibly the major reason why much commercial software is closed source.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: leeor_net on March 19, 2018, 07:40:43 PM
Should still consider a repository. Working the way you are now in your own directory not mirrored anywhere is a recipe for disaster (believe me, I've been there).

I would suggest GitLab only because I've worked with it. You can use private repositories at no cost which will allow you to take advantage of a repository without also having to open your source. Additionally, you can provide access to individuals if you're looking for assistance with some part of your code, etc.

Just food for thought. I've been the victim of years of lost work due to a hard drive crash. It sucks. Like, it really sucks.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: lordpalandus on March 20, 2018, 11:42:20 AM
Alright, I'll look into a repository of some kind for the code, incase of a hard-drive failure some such catastrophe.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: Vagabond on March 21, 2018, 12:00:16 PM
lordpalandus,

If you are working hard on learning Python and do not feel like expending the energy to learn a repository right now, I would recommend once a week zipping the project and saving it to a cloud service to prevent what happened to leeor. This is what I used to do before I learned Mercurial. I would save it to Amazon cloud which had enough space available at the free tier that I never paid for it. I would just zip the entire project every Sunday night. This way if my 2 year old decided to dunk my laptop in the bathtub or something at most I'd only lose a week of work.

If you ever want to work with others, I would highly recommend learning a repository 'language' though. I'd look at Git first as it is very popular and powerful. I learned Mercurial first, but it is a lot more obsure, although I collaborate with people in both Git and Mercurial on a somewhat regular basis.

I currently use Bitbucket to host my private code and it works great. Up to 5 people allowed in a private repository and it allows either Git or Mercurial as the revision control choice. No expereience with GitLab to compare though.

There are other benefits to a repository over just zipping your code and sending it to the cloud though. I find it really helpful that I can traverse the history of my project. It is nice to feel free to delete any code I want and still be able to review it. It can also help to list new features between versions by reviewing commit messages. I also like that I can review my code online without being at my house through BitBucket if I ever want to.

-Brett
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: Hooman on March 23, 2018, 01:58:33 AM
Yes, the version history is wonderful. I find it also adds a psychological boost for making progress. When you can look back and see all the changes you've made, it's helps you keep going. There have also been studies that show a relationship between programmer happiness and version control commit frequency.

The automated remote backup also just kind of nicely comes along with version control. In the case of Git, it's a full history backup for each clone of the repository. For SVN, a working copy only contains the checked out revision, not the full history. It takes a dedicated clone to copy the full history. Relevant, since the OPU SVN repository was migrated about 1-2 months before a hard drive failure, so that was kind of a close call.  ;D


Vagabond is right though, in that you don't want not yet understanding Git to stop your progress. Schedule time to learn it, but don't worry about using it until you're ready and want to. I think we made a mistake before of trying to force Git before people had really learned it. The sudden switch was quickly followed by a serious lack of momentum on any OPU projects. Due to maintenance issues with the self hosted Git repository, we eventually switched back to the old SVN, and only recently started moving to Git again. I'm glad now, though it's easy to forget how much effort it took to learn Git.
Title: Re: Chaotic Planar Prison - Prototype V2
Post by: lordpalandus on March 23, 2018, 01:29:13 PM
@Vagabond; Good suggestion on a temporary solution. I'll likely use my Mediafire account to hold versions, until I can look into an online repository. If I get to the point of having a team, then yes learning something like Git would be essential to good teamwork. However, for now, as I'm the only one working on the code, a simple cloud service will suffice.

@Hooman; Yep, version history is great for that. And with a small enough list of changes, it isn't a chore to sift through them, like it was with CoC updates. I'll likely take the time to learn Git or some SVN later.

Right now, I'm in the process of planning a major code refactor/complete overhaul, and thus I'm busy learning Python, learning how the code interacts with eachother and figuring out how to break the code up into modules in separate files while not having massive amounts of code duplication or logic errors by committing to the code overhaul. Basically, the tutorial is designed for single file, with no moddability, and everything is heavily coupled with eachother. In order for me to make the code modular, and thus easier to read, understand, and add new code to (without creating further spaggetti code), I need to modify the class inheritance and class composition to allow for code modularity, which is going to be quite a bit of work. I'm planning on starting to work on the code refactor next week, and focus on the remaining tasks on this task list, this week. Likely I'll do the refactor in phases; replace one large block of code with a modular code in a separate file and then ensure that there are no new problems introduced by doing it in this fashion. Which also means, that in order to not get bogged down with too much work, the task list will be smaller to compensate. Just giving a heads up now, for my plans with the code and why I have no intention right now to learn Git as I'm simply too busy.

EDIT: As I have had some frustrations with the code this week and I've had to reset the code back to an earlier build to make it runnable again. I'm hoping to knock off a few more things off the task list, before I release the next build today (Sunday, 25th).
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: lordpalandus on March 25, 2018, 03:16:22 PM
Prototype V3 has been now released.

Added a few new systems, addressed some bugs, and the Runestone/Regular Portal are partially functional.

Overall gameplay has significantly improved, with the addition of the A-Star (A*) Pathfinding and should feel quite a bit more challenging.
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: Hooman on March 28, 2018, 04:23:41 AM
Hey, I was just taking a peek at your code, seeing if their are any suggestions I could make.

One possibility is to use enums (https://docs.python.org/3/library/enum.html) instead of string values when the value is meant for machine processing (if statements), rather than user display. It seems enums were added a bit late to Python, so I'm kind of wondering what standard practice is. In other languages, things like 'cancelled', or 'took turn' would typically be represented by an enum, which is just a named constant. This generally protects against typos. If you had returned 'canceled' in one part of the code, it would still compile and run, but not meet if-tests in the expected way, leading to bugs. A named constant must be previously defined, so if there is a typo, it is generally caught during a parse/compile stage and flagged as an error.

FYI: In hindsight, I just realized there is even a bit of controversy here: Canceled vs. Cancelled? (http://grammarist.com/spelling/cancel/)

Now that you've got me thinking about it, I generally try to avoid inflecting words in code. I probably would have chosen 'cancel' for that context.


If you wish to avoid using new Python features, there are other ways to restructure the code that might avoid having to use strings.
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: lordpalandus on March 28, 2018, 10:08:06 AM
Not sure if enumerators are in Python v2.7; might only be in Python 3+. Can check though while I'm doing the Python 2.7 tutorial though.

If I could, I likely would use enumerators, as I found out that I have to explicitly add a temporary value with the stored returned value in order for it to do if-elif statements. So as an example:

Code: [Select]
if 'took turn': 
 for object in objects:
  object.clear()
 return 'took turn'
elif 'cancelled':
 return 'didnt-take-turn'

Even if the program returned 'cancelled', it would always execute the 'took turn' branch. When I stored the returned value in a temporary variable, then it would properly choose the correct branch. So, as I have to use a temporary value anyway, if I could get rid of the temporary variable and the string, and replace it with an enumerator, that would clean up the code quite well.

I will be doing a code clean up, when I redesign and refactor the codebase, but for now, the temporary variable is a sufficient, temporary solution. However, if I can use enumerators, I'll happily change things to it, so that I can test out the enumerators beforehand.



EDIT (leeor_net): added code tag
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: leeor_net on March 28, 2018, 09:10:59 PM

... as I found out that I have to explicitly add a temporary value with the stored returned value in order for it to do if-elif statements. So as an example:

Code: [Select]
if 'took turn': 
 for object in objects:
  object.clear()           
 return 'took turn'
elif 'cancelled':
 return 'didnt-take-turn'

...

Consider revising what you're stating here as I don't follow. This is nonsensical as I'm understanding it... at least from the point of view of someone coming from a background and experience with PHP, C++ and BASIC. Python isn't my favoriate language and it does a lot of weird things but it is still a language that's supposed to make sense... would like to be able to help you out with potential improvements to structured programming.

Also note that depending on how your calling code is formed this could very easily result in an infinite loop in the case of 'took turn'.

Unrelated note -- You can surround your code with [ code ] [ /code ] tags or select your code and click the button with the '#' symbol in it. Makes posting code a lot easier and more readable.
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: lordpalandus on March 28, 2018, 10:00:32 PM
That is a snippet of code related to the shoot_arrow() function call, without the temporary variable. With it would look like:

Code: [Select]
temp = shoot_arrow()
   if temp == 'took turn':
       for object in objects:
           object.clear()
       return 'took turn'
   elif temp == 'cancelled':
       return 'didnt-take-turn'

The shoot_arrow() function if it hits a valid target returns 'took turn'. If you cancel or shot the floor, it returns 'didnt-take-turn'.

Now, in the main event loop there is this chunk of code:
Code: [Select]
if game_state == 'playing' and player_action != 'didnt-take-turn':
   for object in objects:
       if object.ai:
           object.ai.take_turn()
         

If the player doesn't take a valid turn, the enemies do not get to act. Otherwise the game is constantly looping, without end. Whenever your action returns a string that is anything but 'didnt-take-turn', enemies get to act; otherwise they don't. If you remove the 'didnt-take-turn' from the chunk in the main event loop, the enemies would act nonstop with nothing preventing their actions. Effectively, that can turn the game from a turn-based game to a fully real-time game.

I don't personally like this solution, but it is how the developer of the tutorial did it so, I've left it alone. When I do the code refactor, I'm going to have to modify the main event loop a fair bit, so I'll likely change this then as well.

Probably should have mentioned the main event loop portion when talking about the returning of strings before. Sorry about that.
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: Hooman on March 29, 2018, 07:38:17 AM
As an aside, on my install of Linux, the default version of Python is 2.7.

I just tested the enum example code from the first section of the docs, and it all works. I've also read the Enum stuff was backported to earlier versions of Python. Looks like you should be fine to use it.



As for your code, it's doing something interesting that you might not be aware of. Python (and other languages, such as Ruby) have both Boolean values (True and False) as well as Boolean-like values (Truthy/Falsy). Conditional tests extend the concept of True/False to cover non-Boolean values under corresponding Truthy/Falsy classifications. This allows for shorter code to check certain common conditions, though may be a little unexpected if you haven't seen it before. It allows testing for things such as 0/1 (Integers), empty/non-empty strings, and empty/non-empty lists.

For instance, you can check if a string is empty using either of the following:
Code: [Select]
if len(string) == 0:
  ...

Code: [Select]
if string:
  ...

As your string is a hardcoded constant, and of non-zero length, it has a Truthy value, and so the if block if always executed. What you wrote is roughly equivalent to:

Code: [Select]
if True:
  ...

StackOverflow has more discussion on Truthy/Falsy in Python (https://stackoverflow.com/questions/39983695/what-is-truthy-and-falsy-in-python-how-is-it-different-from-true-and-false), including a more complete list of Truthy/Falsy values.
Title: Re: Chaotic Planar Prison - Prototype V3
Post by: lordpalandus on March 29, 2018, 09:37:17 AM
Interesting. That would explain some of the other sections of the code as well. Such as:

Code: [Select]
while True:
...

Where the while loop is only terminated when you reach a Return statement. Otherwise it loops permanently. Generally I've only seen C++ or JavaScript loops where there is a specific Boolean condition attached to the loop. ie:

Code: [Select]
while (x > 0 and x < 10): 
...

Thanks for giving a link on Truthy/Falsy!
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: lordpalandus on March 31, 2018, 04:00:56 PM
Prototype V4 is now released.

New Stuff: Mouse highlighting of square underneath cursor, fixes a variety of errors, implemented attributes and attribute training, increased the difficulty of the enemies (will look into improving challenge in the future), you now respawn at the last attuned runestone when you die (will look into creating the stress-based permadeath this week), and added a new item satchel, which stores all your scrolls and potions, reducing the clutter of your inventory.

Enjoy!
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: Hooman on April 06, 2018, 02:18:18 AM
Making a second attempt at getting this to run on Linux. Compiling a copy of libtcod on Linux now. Just realized the libtcod repository uses Mercurial. That's probably why my attempts to download the source with Git failed last time. :P


Minor thing I noticed while scrolling through the source file. You seem to have a lot of mixed tabs/spaces, and trailing tabs/spaces at the end of lines. I have "show whitespace" enabled in my editor, so it's easy for me to see. If you find that option in Notepad++ and turn it on, you'll see it too.

If you want a quick way to remove trailing tabs and spaces, you can use the find/replace box. Search for whitespace followed by an end-of-line, and replace with nothing. I believe the regular expression for that search is "\s+$", without the quotes. The "\s" will find whitespace (tabs/spaces), the "+" finds 1 or more occurrences of the previous. The "$" should find the end of line. See Notepad++ Regular Expressions (http://docs.notepad-plus-plus.org/index.php/Regular_Expressions) if you want to check the docs.

There's also some info on StackOverfow about Trimming Trailing Whitespace with Notepad++ (https://superuser.com/questions/699382/how-do-i-automatically-trim-trailing-whitespace-with-notepad).

To replace tabs with spaces, you can search for "\t" (the tab character), and replace it with the appropriate number of spaces in the replace box.

Quick and easy way to tidy up source code.  :D
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: lordpalandus on April 06, 2018, 08:48:38 AM
Few questions:

1) Why does it matter if I have a bunch of white spaces?

2) Doesn't the compiler/interpreter skip over them, much like they ignore comments?

3) I do intend to completely rebuild the codebase, with all my listed design requirements, at a later date (probably before the game reaches beta state), so why put all the effort into addressing white space/extra tabs with throwaway code?
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: leeor_net on April 06, 2018, 09:35:05 AM
Few questions:

1) Why does it matter if I have a bunch of white spaces?

It's not that you have a bunch of white spaces, it's about consistency in which type of tabbing you use. I prefer tabs, many developers prefer spaces. In either case, choose one method of tabbing and stick with it.

2) Doesn't the compiler/interpreter skip over them, much like they ignore comments?

Yes, but white space isn't for the compiler, it's for the humans reading the code. And in the case of Python it's actually how you specify blocks of code.

3) I do intend to completely rebuild the codebase, with all my listed design requirements, at a later date (probably before the game reaches beta state), so why put all the effort into addressing white space/extra tabs with throwaway code?

Fair point. However in this case it's a matter of setting best practices and getting you used to doing the same thing to keep things consistent. If ultimately you're just going to throw it away who cares but it does make sense to pick a style and stick with it.
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: lordpalandus on April 06, 2018, 09:23:05 PM
The code is written with 4 spaces, and is consistent throughout. Anytime I accidentally place a tab, it causes a syntax error.

There may be tabs in the blank white spaces or tabs in the #comments, but that isn't intentional on my part; they are added in by Notepad++. For the redesign, I intend to go for tabs, as I prefer tabs.

Well, for me, the code is perfectly readable, for me, as it currently stands. And as I'm the only one adding / modifying the prototyped code, as long as I can read it, it should be fine. I do want to have a more consistent and pleasant reading when I redesign the code, as I'll want the code to be moddable or even just easy for me to add things to the code. I am however, aware that some of my duct-tape code is starting to cause the prototype code to look like spaggetti code, and that is regrettable. Unfortunately, due to the way the tutorial made the roguelike code, everything is coupled with eachother and often information needs to be explicitly placed more than once in some places to make it work properly. Not an ideal solution, but it doesn't really matter at the moment as its just throwaway code.

I do intend to go with a consistent style, but my style isn't how the tutorial code was made, and thus I have to work with what I got for the time being, thus in several places it will have conflicting styles in the current codebase. I intend to have a consistent naming scheme (ie for functions, variables, classes, etc), comment methodology, and code structure philosophy in the redesigned code.

Title: Re: Chaotic Planar Prison - Prototype V4
Post by: Hooman on April 07, 2018, 11:42:26 PM
Leeor nailed it, in that it's an issue for people, not the compiler. It's one of those intangible things, likely badly indented C++ code. The compiler doesn't care, but it can make working on the file awkward.

Quote
3) I do intend to completely rebuild the codebase, with all my listed design requirements, at a later date (probably before the game reaches beta state), so why put all the effort into addressing white space/extra tabs with throwaway code?

The cost of a complete rewrite is high. In practice it rarely happens. People are more likely to give up on a project than perform a complete rewrite.

Quote
The code is written with 4 spaces, and is consistent throughout. Anytime I accidentally place a tab, it causes a syntax error.

There may be tabs in the blank white spaces or tabs in the #comments ...

Exactly. It's not consistent. Since indentation is part of the Python grammar, it will warn you, but only for code lines. Your comment lines and blank/spacer lines often start with tabs.

As for how this happens, typically it's when you try to backspace a seemingly empty line when the cursor is in the first column, yet the line already contains whitespace for indentation which can't be seen:

Code: [Select]
if True:
    operation()
|(<-blinking cursor)(whitespace)
    operation2()

Backspace:
Code: [Select]
if True:
    operation()|(<-blinking cursor)(whitespace)
    operation2()

This affects further editing. If you try to edit the end of that line, the cursor might now go to the end of the whitespace, rather than the last visible character. This can slow down editing as you now have to navigate that whitespace. It also makes it harder to plan ahead what keys to press if you can't see or predict where the cursor will go, which leads to more mistakes, revisions, and a higher mental load when you're already trying to remember multiple lines you have to edit.

This can also lead to messy diffs when version control is used. Instead of just changes to functional code, the diff might now show whitespace changes, making them harder to read and review. Worse, some editors, such as Atom (using default settings) will attempt to automatically "fix" these whitespace issues. Someone might try to make a one line edit, only to find the diff now contains changes throughout the entire file. The actual functional change gets lost in the noise of whitespace changes.


Finally, the find/replace all edit I suggested is an automated way to fix it all at once, and should take all of 10 seconds.  ;)

Though I do encourage you to play around with the find/replace box for a couple minutes to explore and fully understand what is happening and how it works.
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: lordpalandus on April 07, 2018, 11:54:34 PM
It is true a complete rewrite is expensive to do. However, it can also be argued that fighting with code that is meant to be a prototype and not final code, and constantly bug fixing esoteric errors, can be even costlier.

However, I think that designing good code, from the start, takes practice. If you design good code from the start, and maintain that good code, then you don't have to do rewrites and you don't have to excessively bug hunt. I'm not quite at the stage where I can design code properly the first time, otherwise I would. I have to work with the skills and knowledge I know and work from there.

As far as the rewrite goes, I intend to do it in phases; rebuild one section of the code at a time, and build it into the current prototyped code. Then, continue to work at modularizing the code, and eventually have no prototype code left, as I've replaced it all. Basically, use the working prototype code as a "driver" to ensure my new, final code, has no immediately obvious bugs, and continue to replace prototype code with final code, until I have only final code left.

Actually Notepad++ adds those tabs whenever I hit Enter at the end of a line, thus ensuring that every time I try to do a line of code, I have to remember to delete those added tabs. Hence, why I want to switch over to purely tabs.

EDIT: As for this week's build, it will be a bit sparse on changes. I have gotten through more of the tutorial and fixed a couple little bugs I couldn't address before, as I had no idea how to implement them. I'll see what I can muster between now and tomorrow, to address the things on the list.
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: Hooman on April 08, 2018, 12:08:16 AM
What you're describing is code refactoring. Definitely a very important skill. Refactoring is lower cost than a complete rewrite, particularly from a psychological standpoint, and precisely because it's done in stages. You should always have working code, and so you can keep using, and extending the code, even with further cleanup coming. It also nicely addresses the issue of not having a perfect design the first time, and the importance of just starting, and fixing things along the way.

To do refactoring cleanly, code quality issues such as whitespace matter even more. Whitespace issues can add a lot of noise to the refactoring process. Hence, it is typically taken care of up front, in an automated way, and in its own commit. Functional changes would then follow in subsequent commits.


Edit: Notepad++ can be configured to use either tabs or spaces for the indent, as well as the indent width (4 spaces, 2 spaces, etc.). I believe it can be configured either globally, or per language.
Title: Re: Chaotic Planar Prison - Prototype V4
Post by: lordpalandus on April 08, 2018, 03:26:47 PM
Hmm. Okay. I figured that as I intend to replace all of the existing code with new and modular code, that would be considered a full rewrite... its just that I'm doing the full rewrite in stages, to have working code to test out the new code to ensure that no new bugs are created with the new code.

Also good to know on the Notepad++ indenting. I'll look into it.

---

As for today's release, I have a few more things I'd like to try to implement, and once that is done, I'll release Prototype v5.
Title: Re: Chaotic Planar Prison - Prototype V5
Post by: lordpalandus on April 08, 2018, 05:00:35 PM
Prototype V5 has now been released.

I had a rough week, with several days of extreme mental exhaustion, and my osteoarthritis in my knees acted up this week, so I had a bad limp and a lot of unavoidable pain. So I didn't accomplish as much as I had hoped to this week, but this release still has a few interesting features. These are:

- Three new rare item types = Amulet of Energy (+25 Energy and 1 Energy Rejuvenation per turn), Elixirs of Attribute (+3 to a specific attribute), and Manuals of Attribute (provides 750 + 3*number of Manuals read before XP training for that attribute and each one read increases XP gained whenever you perform an activity).

- The first Primal Chaos creature is now in; the Primal Chaos Orc. It is capitalized and bright red. Also, activated the Chaos Portal, that will spawn these nasty critters too.

- The first Ranged combatant is now in; the Goblin/Orc Archers. They are bright yellow and will attack you at a range. They will also flee from you if you get too close. The AI is a bit stupid, and thus they don't pathfind easily around objects. They have half HP and half damage as a melee attacker of the same name (ie goblin)

- When you die and respawn, you will properly lose your entire inventory, forcing you to have a fresh start at life, at least in terms of equipment.

- Made some changes with items and item generation. Items now have a material tier (ie fine cloak or ironite coif) and you can see this by hovering the mouse over the item. Also, better equipment will only drop in later levels now, rather than at the very first level.

Hope you guys enjoy, and I hope I have a better week, next week!
Title: Re: Chaotic Planar Prison - Prototype V5
Post by: Vagabond on April 09, 2018, 12:26:46 PM
Sorry to hear about your knees acting up. Knee problems are pretty miserable to deal with.

I haven't tried Chaotic Planer Prison yet, but it sounds like you are making a lot of progress.

-Brett
Title: Re: Chaotic Planar Prison - Prototype V5
Post by: Hooman on April 10, 2018, 02:40:07 AM
I haven't managed to try it yet either, though mostly because I haven't gotten it working on Linux yet. Seems like the libtcod library author doesn't directly support Linux, instead deferring that to the community to support. I tried downloading the library source, compiling it, and installing it, though the game and any library sample code fails to find the library.

Seems like it should be an easy configuration fix, though I have yet to figure it out. Maybe some combination of PATH and PYTHONPATH will work.
Title: Re: Chaotic Planar Prison - Prototype V5
Post by: lordpalandus on April 11, 2018, 11:48:35 PM
No worries. It might be best that people passed on the earlier builds.

However, the newest build, is proceeding quite smoothly and have implemented a variety of desired features, that were on the backburner, into the game now. Such as:

You can now simply click on a target with the mouse to attack it with a ranged-based attack. LMB to shoot an arrow and RMB to zap them (new basic spell).
Title: Re: Chaotic Planar Prison - Prototype V6
Post by: lordpalandus on April 14, 2018, 02:52:28 PM
Released Prototype V6!

I was very productive this week, had only a slight limp from the osteoarthritis, and only had one day of mental exhaustion. The changes in this build are too numerous to list in a single post, so I suggest reading the Changelog and Readme file, that details the changes, particularly to the controls.

Enjoy!
Title: Re: Chaotic Planar Prison - Prototype V7
Post by: lordpalandus on April 21, 2018, 05:28:56 PM
Released Prototype V7!

Lots of new changes with this build, so definitely take a look at the changelog if you are interested, or read the first post, that highlights the biggest changes. Also, fixed I believe all of last week's bugs, for this build, including the flee code for mages/archers and melee related bugs.
Title: Re: Chaotic Planar Prison - Prototype V7
Post by: leeor_net on April 22, 2018, 04:40:18 AM
Ech, requires download and install of python interpreter. Yuck. :P

Should really make this a self contained package with everything that a user needs to run it without needing to download and install runtime environments.
Title: Re: Chaotic Planar Prison - Prototype V7
Post by: lordpalandus on April 22, 2018, 03:48:06 PM
I plan to. Eventually. I have higher priority stuff that needs doing first though.

I'll look into providing a Binary executable when I reach Alpha Status. At that point, the game will be more of a game, rather than a modified tutorial, and thus will be worth taking the time into looking at making it more new user friendly.
Title: Re: Chaotic Planar Prison - Prototype V7
Post by: leeor_net on April 22, 2018, 04:16:10 PM
Fair enough.
Title: Re: Chaotic Planar Prison - Prototype V7
Post by: Hooman on April 27, 2018, 09:35:02 AM
And as a counter point, I'm less fond of having the entire Python environment distributed with the game. I tend to trust binaries more from the official source. Plus it's a large amount of data to add to the zip file, and would do me no good on Linux, which btw, already includes a Python install by default (as many system scripts use Python).

Though yes, for final end users who just want to play a game, having a complete install package is very appealing. But that's more of a version 1.0 problem.


Good to hear you're still making progress!
Title: Re: Chaotic Planar Prison - Prototype V8
Post by: lordpalandus on April 28, 2018, 06:44:23 PM
That is definitely a fair and good point, Hooman! I would prefer the same as well, just haven't figured out how to do so yet, as it hasn't been a priority.

Also:

Released V8 of the Prototype. This was another very productive week and managed to get several features in that I've been puzzling over, for the past several weeks on how to implement; ie Area of Effect highlighting for the area that a spell will affect, as well as the Knockout system. Other big changes are: a huge overhaul of the UI, Primals are significantly tougher now, Damage types, Different effects from each Portal, and fixed quite a few bugs.

Enjoy!
Title: Re: Chaotic Planar Prison - Prototype V8
Post by: Hooman on April 29, 2018, 06:56:55 AM
I took another quick look through the code, seeing if there are any shortcuts you could take. I noticed this part:
Code: [Select]
    #This function advances the player to the next level. You will regain 50% of your maximum HP before entering the next area.

    global dungeon_level, Attuned_Status, Activation_Timer, Difficulty_Level, Monsters_Spawned
    message('You take a moment to rest, and recover your strength.', libtcod.light_violet)
    player.fighter.hp = player.fighter.hp + (player.fighter.max_hp / 2) 
    player.fighter.ep = player.fighter.ep + (player.fighter.max_ep / 2)

    if player.fighter.hp > player.fighter.max_hp and player.fighter.ep > player.fighter.max_ep: #both above maximums
        player.fighter.hp = player.fighter.max_hp
        player.fighter.ep = player.fighter.max_ep
    elif player.fighter.hp > player.fighter.max_hp: #only hp over maximum
        player.fighter.hp = player.fighter.max_hp
    elif player.fighter.ep > player.fighter.max_ep: #only ep over maximum
        player.fighter.ep = player.fighter.max_ep

Looks like you're doing some value clamping, a very necessary and common operation. Consider using two independent if statements to reduce redundancy:
Code: [Select]
    if player.fighter.hp > player.fighter.max_hp:
        player.fighter.hp = player.fighter.max_hp
    if player.fighter.ep > player.fighter.max_ep:
        player.fighter.ep = player.fighter.max_ep

Another place you can remove some redundancy, is the section above that adds half the max value. Consider using += when you want to add to a value, so you can avoid having to write the same variable twice:
Code: [Select]
    player.fighter.hp += (player.fighter.max_hp / 2)  
    player.fighter.ep += (player.fighter.max_ep / 2)
Title: Re: Chaotic Planar Prison - Alpha V1
Post by: lordpalandus on May 05, 2018, 01:53:12 PM
Thanks for the suggestion Hooman. I also implemented that fix now in a few other spots in the code where I used similar code snippets.

EDIT: Released Alpha V1. Enjoy!
Title: Re: Chaotic Planar Prison - Alpha V1
Post by: Hooman on May 09, 2018, 06:00:11 PM
Hmm, just noticed this is now Alpha. Is there a particular milestone you've hit?


I'm curious, is there any specific area of the code you have working, but might want to improve? Maybe shorten things up. Maybe make it more flexible or easier to edit, maintain, or extend.
Title: Re: Chaotic Planar Prison - Alpha V1
Post by: lordpalandus on May 09, 2018, 07:11:42 PM
Yes? Over the past 4 weeks I've been working on a 30 point list on the very first post of this thread, and finally managed to complete the last few points in the Proto9 / Alpha 1 build (whichever you prefer). Now, I have a 40 something point list of things I need to complete for the game to be considered "beta" on the first post of this thread.

Yes, and that applies to 90% of the codebase. Over the next few weeks, I intend to modularize the code into several specific files (ie Everything Player Character, All Global Stuff, etc), sort out the code so that everything for a particular thing is found in the same spot (ie Level up Code), work on reducing redundancy on several functions that are essentially duplicated, and could be all combined into a single function, improving code documentation with a consistent theme for comments and the inclusion of doc strings where applicable, and I am working on using a consistent theme for naming things (ie, my globally accessible variables will now be in all capitals to help me in noticing them)

EDIT: I've tried to do some of the modularization in Alpha V2, but with little success. Much of the codebase is heavily coupled with eachother, and even moving a class or function to another file causes the code to bork. So, a lot of the code is going to need to be heavily redesigned to accommodate multiple file modularization. Alpha V2 will contain the start of the modularization, with the GLOBALS module (contains all of the global variables and lists used by the game, all neatly sorted and almost all documented)
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: lordpalandus on May 12, 2018, 03:17:55 PM
Alpha V2 is released.

Due to having spent most of the week repairing the codebase, at my three separate attempts at performing a major refactor of the code and to start off the code modularization process, I didn't accomplish most of my task list. I did accomplish a lot of under-the-hood stuff, and figured out why those attempts at refactoring the code base failed, but the overall new content in this release is slim; three new Rare items are now available to be found (Rune of Recall, Rune of Mapping, and Holy Hand Grenade).

I'm now quite exhausted, so I'm going to go lie down. I intend to stay focused for next week, and make sure to complete my tasks before trying any other drastic code-base changes.
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: Hooman on May 13, 2018, 12:27:28 PM
Quote
Holy Hand Grenade
Excellent  :D

Sounds like you've got a pretty good plan.
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: lordpalandus on May 15, 2018, 09:34:12 PM
Yep.

Question (to anyone who reads this): Is there any particular reasons why there isn't any current interest to this game, in terms of feedback or replies to this thread? Is it because of compiling issues, or is it not enjoyable, or is it boring, or something else?

I ask because there is very few replies to this post, other than Hooman, and occasionally leeor_net, but yet some weeks downloads are only 1, and other weeks they are close to 10. For those weeks when there are few downloads, it would be useful to know why no one touched it; and on the other hand, when there are a lot of downloads, are people having any feedback for it?
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: Hooman on May 15, 2018, 11:34:25 PM
For me it's compiling issues. Hence why most of my comments are about the source code.

With your other project, it was hosted on the web, so very easy to try out.
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: Vagabond on May 16, 2018, 11:35:15 PM
I'm generally interested in the game but am waiting for you to progress further as it is still very early in development. If you have specific need for testing, I would be happy to help.

-Brett
Title: Re: Chaotic Planar Prison - Alpha V2
Post by: lordpalandus on May 17, 2018, 08:42:31 AM
Alright.

Then, I'll see about trying to prioritize learning how to build a binary, and look into determining when I desperately need playtesting; likely mid-alpha, perhaps?

Thanks for the feedback.
Title: Re: Chaotic Planar Prison (Game Renamed) - Alpha V3
Post by: lordpalandus on May 20, 2018, 02:47:08 PM
Alpha V3 is released! New changes are = Separate technique menus (Shift Z, Shift M, Shift T), Disintegration now works, Two new Utility spells, Did a lot of work under the hood, rebranded the game as Cataclysm of Chaos, A lot of interface improvements, Heavily modified game balancing, Fixed a bunch of bugs, Added Resource Nodes and On the Move Crafting, Monster Updating is now active, Primal Updating is now active, implemented random monster names, and you now spawn randomly in the map rather than in a corner. Most of the stuff on my weekly task list turned out to be far more complicated than I originally thought and thus only a few things actually got solved.

If I can figure out how to use PyInstaller in a timely manner, then I'll release the binaries for Alpha 3.

===========================

EDIT: PyInstaller isn't working or I didn't install it properly. Either way, it is going to take me a while to figure out what is going wrong, so unfortunately, it doesn't look like I'll be able to bundle binaries with this release, but I'll try to have it in for Alpha V4.

EDIT2: For some reason my OS is not recognizing my Python 2.7 install. Pip, a program used to install Python modules, couldn't detect it, yet it is installed on my C:/. I also tried another program, py2exe to try and make an executable, but it failed to work because the command-prompt keyword/command python isn't recognized. So... I think I'm going to have to figure out how to fix my python install or something. Regardless, I doubt I'm going to figure it out anytime soon, so no binaries for Alpha V3. Sorry.

EDIT3: It is unlikely that I'll have binaries for next release either. I've tried several fixes online to try and get the system to recognize the Python2.7 install, but none of them have worked. I tried adding it to the environment variables into Path, but cmd.exe still doesn't find python; if I go manually to C:\python27, it will load up Python properly. I tried to add it to the registry and that didn't work. I'm at wits end, so until I figure out how to either register python27 or how to get the OS to accept the path to the python interpreter, the creation of a binary is not available.
Title: Re: Chaotic Planar Prison (Game Renamed) - Alpha V3
Post by: Hooman on May 21, 2018, 02:05:44 AM
Perhaps you already know, but just in case, if you update environment variables through a settings GUI, you generally have to restart any open command prompts for the new settings to take effect.


I'm curious about the cross platform build potential, and what steps I might do to replicate your efforts. I assume this program is to package Python code with a Python interpreter. That might not be quite enough though, since the code relies on the libtcod native extension. That's not quite so easy to package or build cross platform. The packager might not be smart enough to account for this dependency, or might need extra configuration to account for it.
Title: Re: Chaotic Planar Prison (Game Renamed) - Alpha V3
Post by: lordpalandus on May 21, 2018, 09:42:35 AM
Well, apparently reinstalling python 2.7, and making sure that the checkbox for installing in Path, was checked, now properly allows me to use the command python in cmd.exe, without getting an error. Haven't tried the other stuff like pyinstaller yet though.

Actually, I did restart it, before reinstalling python 2.7, and it didn't work. Only by reinstalling python 2.7, did it work. Maybe it required both a proper registering in regedit AND assignment to path to get it to work.

----

Well, pyinstaller is more advanced than py2exe, and thus I'd probably go with it. It is robust enough to detect other libraries, by scanning all of the import keywords and building the appropriate libraries into the executable OR having them as dlls. Py2exe should work as well, as the actual roguelike tutorial suggests it for making binaries. However, py2exe only works on windows and only makes windows binaries. Unfortunately, to get pyinstaller to create a binary for Linux / mac, you have to run pyinstaller on those systems; ie I can only build windows binaries as I only have access to a windows OS, so if someone wanted a Linux binary, I'd need access to a Linux to create it OR explain how the end user can create a binary on their machine.
Title: Re: Chaotic Planar Prison (Game Renamed) - Alpha V3
Post by: Hooman on May 21, 2018, 11:14:53 PM
I suppose that's good reason to document the process then, so people can help out with the other platforms. If you have good instructions for Windows, that can help people figure out how to do it on Linux or Mac. Once a solution is found, it might be possible to setup Docker to compile and package things for other platforms using virtual machines running on Windows.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V3
Post by: lordpalandus on May 23, 2018, 10:42:18 PM
Good to know!

Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V3
Post by: lordpalandus on May 27, 2018, 12:59:00 PM
Alpha 4 is proceeding along smoothly, and will be released later today. I accomplished a lot this week, in terms of modularization and code refactoring, and still have a few more features to complete before I release Alpha V4. I'll update this post when I've released Alpha V4.

EDIT: Alpha 4 is now released! Got a lot done this week, but now I'm quite exhausted after doing about 3 days straight of heavy coding, refactoring, and designing, and I'm going to take a break now and recuperate. Next week will be focused on learning the interface, libtcodpy library console-modification commands, and look into implemented a lot of my ideas for improving the interface (I have a long list of ideas). Still haven't fully resolved my issues with PyInstaller or Py2exe, so no Binary this week yet.

Regardless, hope you all enjoy!
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: lordpalandus on June 02, 2018, 06:10:29 PM
Alpha V5 is released.

Biggest noticeable change is that I've managed to get pyinstaller to work, and I now have a compiled binary version available (for windows). I also have binary compiling instructions in the loose-files version, which is the one that is attached to the first post, in case anyone on Linux/mac wants to give it a go at trying to make the game run on their native OSs (I don't have access to Linux or mac machines).

I struggled this week, partly due to exhaustion and partly due to the interface code being a royal tool. I didn't get any of the interface related tasks done this week, but I better understand the problems with the interface, so at least that is a thing. However, I still accomplished a lot of gameplay related stuff this week and of course the aforementioned binary is now a thing, for future builds.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: Vagabond on June 02, 2018, 08:10:45 PM
Lord Palandus,

I downloaded the new binary release and checked it out briefly. Is there a way to adjust the resolution to match my monitor? The text spills off the right and bottom of the screen making it tough to play.

Check out the screenshot for what I mean. This is from a Windows 10 1080P laptop for reference.

-Brett
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: lordpalandus on June 02, 2018, 09:09:34 PM
That is an odd occurrence.

I'm running a monitor with 1920x1080p myself, windows 8.1. Though mine is a desktop, which may make some kind of difference.

Does fullscreen mode do anything (ALT+ENTER) to alleviate the issue?
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: Hooman on June 03, 2018, 10:50:23 AM
Just a note, users DPI settings can affect display size.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: Vagabond on June 03, 2018, 05:04:45 PM
Yeah, selecting full screen fixed it. After initially setting fullscreen, everything fit properly even after cycling out of fullscreen, or closing and reopening the app. So it is only a problem on the very first open of the app.

-Brett
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V5
Post by: lordpalandus on June 03, 2018, 07:34:20 PM
Good to know. I'll mention that in the Readme file to use Fullscreen at least once, to fix screen resolution issues.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V6
Post by: lordpalandus on June 10, 2018, 01:34:22 PM
I'm hard at work with Alpha V6, and plan to have it out later today, with a fresh binary.

EDIT:

Alpha V6 is released, with an accompanying Binary for those that prefer it.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V6
Post by: Hooman on June 11, 2018, 11:42:43 AM
Good to hear about the progress.

Would you consider posting any screenshots?


On another note, I should discuss Control-Driven Programming versus Data-Driven Programming with you. People generally start out with Control-Driven Programming, though I believe Data-Driven Programming would be very useful to you on this project. It would allow you to add new game items much quicker, rebalance things easier, and generally just focus more on the core gameplay, rather than spending time fighting with bugs, trying to express needlessly convoluted logic to the computer, or editing/maintaining old code as you add new features.

I haven't really found a good explanatory article on it though.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V6
Post by: lordpalandus on June 11, 2018, 02:11:26 PM
I can look into providing some screenshots, for sure.

What is the major differences between the two coding approaches?

I have been doing large refactors of various parts of the code, and as such, I may be inadvertently already using a Data-Driven Approach. As I'm self-taught, I'm not aware of nomenclature or computer programming jargon, and thus I may be doing things the right way, without knowing what is the right way.

EDIT: Don't have a lot of time today, but here are two screenshots. I'll look into providing more later. These are from starting up the game.

EDIT2: I'm in the process of fixing some bugs, but I'm hoping to get a few more screenshots up!

EDIT3: Got the bugs fixed, and two new screenshots. The two new ones are from playing after about 30 minutes... I recently had died, as I got cocky and dived into the middle of 4 enemies that massacred me.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V6
Post by: lordpalandus on June 14, 2018, 04:29:14 PM
Here are a few new screenshots, but with the latest Alpha V7 build, that will get released Saturday/Sunday. Some explanations:

Screen1 = On the Run Crafting Menu, with a new item, the Energy Shield.

Screen4 = Ranged Technique Menu, with all Techniques available. The Blue + is a Runic Fountain (for refilling Runic Elixirs) and the Red g is a Goblin Mage.

Screen5 = Melee Technique Menu, with all Techniques available. The Blue g is a Goblin Fighter (of some sort) and the White A is a Crystallized Archer, which is effectively a treasure chest.

Screen6 = Spell Technique Menu, will all Techniques available. The Blue # is a Metallic Scrap Pile and the Green # is an Organic Scrap pile. The other symbols on the map (ie X, ], [, /, etc) are items I decided in not taking with me.

Screen7 = A new major system in this next release is applying and taking advantage of Fear or Confuse. Some abilities apply these effects and others take advantage of them to brutal effect. If an ability takes advantage of one, it will provide an automatic critical and then remove the effect. You can also still naturally fear archers by getting too close or attacking mages to cause them to flee, and any abilities that take advantage of fear will take advantage of these situations. Also, the slightly blue [ and \ are magical items, that I didn't want (was playing as a Mage this run and the higher your melee protection the higher the energy cost of your spells).

Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V6
Post by: lordpalandus on June 16, 2018, 08:23:53 AM
Two New Screenshots.

Screen1 = The Runestone Menu; Has several new options available in Alpha7, such as Attribute Training, Resource Transmutation, and Increasing Global XP rates.
Screen2 = A battle between two Primal Chaos Mages (Purple M), at the Primal Chaos Portal (the black asterisk). Unfortunately for me, they drained too much XP and I lost a level and gained stress.

Would have posted more screenshots, but I found a hard-to-find crash bug and the game crashed. Managed to get to Floor 3 and to level 28, as an Archer.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V7
Post by: lordpalandus on June 17, 2018, 11:45:01 AM
Alpha V7 is released. Main page has a Binary and an uncompiled version as usual. This Alpha I accomplished the most in, and is the longest changelog to date. I've listed the major highlights on the first post's page.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V7
Post by: Vagabond on June 18, 2018, 10:00:17 AM
Lordpalandus,

I've been impressed by the steady progress you have been making. Keep up the good work!

-Brett
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V7
Post by: lordpalandus on June 18, 2018, 04:09:14 PM
Thank you.

My "plan" for this week is to now address challenge, AI, and user interface related issues. As most of the progression systems are in, it can lead to a feeling of being able to steamroll your foes with ease, especially if you get lucky and get a few Rares or an Epic at the start of the game.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V7
Post by: Hooman on June 19, 2018, 07:57:41 PM
Huh, this looks much further along than I expected. Looks to be in a decently playable state.

I assume you mean "Rune crafting"?



As for my earlier comment, I noticed you have long sections of control flow code that basically define data. Think of areas of the code that appear to be copy/pasted with a few values updated. This could be cascaded if blocks, switch statements, or a series of similar functions. This would be an example of Control-Driven Programming, as all the data is embedded in coded control structures.

Data-Driven Programming would be more like having a big array of objects, which may be searched or indexed. Changing data is just changing entries in an array. The data could be a hardcoded array in the source file, or perhaps included as a secondary source file separate from the game logic. It could also be loaded from disk as a data file.

If you want to move towards Data-Driven Programming, a general rule of thumb is avoid copy/paste/update of code. That is particularly true when control flow is copied/pasted with it. If you find yourself doing this, see if you can convert the data into an array of structs/objects. It's perfectly fine to copy/paste/update array elements.

As a side note, you can generally tell code/logic apart from data/memory based on how it looks. Code and logic appears chaotic while data and memory appear regular. Take for instance an image of a CPU die. You can physically see where the CPU cores are versus where the cache memory is. Here's an image of a Core i7 die for you:

(https://forum.outpost2.net/index.php?action=dlattach;topic=6073.0;attach=1326;image)

If you open an executable file with a hex editor, you'll notice the same thing. Scrolling through the code section, it will look like a chaotic mess. Scrolling through the data section will show large chunks of regular data, which often aligns visually into columns and blocks. As an example, here's the start of the code and data sections from Outpost 2:

(https://forum.outpost2.net/index.php?action=dlattach;topic=6073.0;attach=1328;image)

(https://forum.outpost2.net/index.php?action=dlattach;topic=6073.0;attach=1330;image)

Your source code will likely be similar. The code will look irregular. Each algorithm solves a new problem. Otherwise, you'd have just reused the old code. The data, particularly any hardcoded arrays, will probably look fairly regular.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V7
Post by: lordpalandus on June 19, 2018, 10:35:39 PM
Oh, yes, it is very playable. No endgoal or victory condition yet, but can be played as an infinite depth dungeon crawler right now with a fair amount of enjoyment to be had.

I should really get in the habit of choosing a specific jargon and sticking with it, rather than have it mean different things. There are two types of Runes in the game; consumable Runes (Recall, Mapping, and Fabrication) and profile-bound Runes (Equipment Runes, Greater Runes, and eventually Legendary Runes). With high enough Crafting Mastery you can craft the consumable runes... or you can create Enchanting Orbs and upgrade profile-bound Equipment Runes. However, I can chalk up a lot of this confusion to my inexperience at designing games and systems... I'm gotten a lot better, but clearly have a ways to go.

Yes, and that is why I have modularization listed as tasks to complete; take large sections of essentially duplicated code, figure out a way to combine it all (whether with a powerful function or class composition or class inheritance) and then move large sections of that new code to a separate file. Slowly and yet surely I'm getting rid of tons of duplicate code and replacing it with significantly less code that does the original job, but also so much more and is far more flexible and reusable than the old code was.

One of the things I want to do for Alpha V8, is to greatly reduce the redundancy of code with the AI classes by using Class Inheritance, rather than have 6 separate classes that all share a lot of code, but each have their own specific things needed to operate properly; an excellent place where Class Inheritance can work wonders.

I've also tried to figure out how to use lists, list comprehensions, tuples, dictionaries, and list manipulation techniques (ie extend, remove, pop), to try to reduce redundant code, but thus far haven't had a ton of luck with that. As I continue coding, I do find places where these things would greatly help to reduce code redundancy and deter copy/paste code, and have implemented it in the places where I found a purpose for them. However, trying to stay on task, and produce a weekly build discourages me from sitting around rebuilding old code, unless the rebuild allows me to add new code in more easily. As I mentioned above, I intend to redo the AI classes, as I intend to clean up the AI code and try to more easily streamline the AI pathfinding code, as I can see already that it may be quite a bottleneck on gameplay performance once the map gets filled with a lot of enemies.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V8
Post by: lordpalandus on June 24, 2018, 05:48:44 PM
Released Alpha V8. Binary and Uncompiled build on first post.

Enjoy!
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V8a
Post by: lordpalandus on June 25, 2018, 12:58:14 PM
Released a Hotfix for Alpha V8.

Implements a better pathfind system for the "dumb" pathfind system (ie not the computationally expensive A*Star system); used by both the flee code and the move towards code. Also, added a message for when you hit a fleeing foe, removed debug items that I forgot to remove, and fixed a bug with Spellcasters not fleeing when hit.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V9
Post by: lordpalandus on July 01, 2018, 05:41:28 PM
Released Alpha V9. Another huge release, possibly bigger than Alpha 7.

Binary and Uncompiled Build on first post. Enjoy.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V9
Post by: Hooman on July 01, 2018, 09:02:17 PM
Huh, I'm getting behind on checking out these updates.  :P
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V9
Post by: lordpalandus on July 02, 2018, 03:52:52 PM
At this point in development, with the lack of user feedback, I'm mostly just posting these updates for my own benefit. It keeps me on track, focused on my task list and disciplined in producing a stable build each week, which is very motivating. Though, if no one downloads this week's binary, I'm going to stop posting it and only give a link if someone ACTUALLY wants to play it.

The whole point of getting the binary build up was so that people wouldn't have to struggle with setting up the python interpreter, but as the only binary build that got ANY downloads was V7 (V6 got 1 from I think Vagabond who posted the graphical error), I just don't see the point of going to the hassle of compiling a build that literally no one is going to play.

I'll continue to post the uncompiled one, that requires the python interpreter on one's system, for anyone who wants to try compiling it for their host system, that isn't Windows. But, if the Binary this week gets no downloads I'm going to stop building the binary unless someone actually wants to play it.

Then again, if I do get accepted into GOG's in-development program, they may stipulate that I have to stop releasing free builds here on OPU, if I'm going to have others on GOG.com / GOG Galaxy paying for it. But, I'll cross that bridge when I get there.

EDIT: Immediately after posting this, I checked the Mediafire page, and turns out 7 unique downloads of V9 has occurred. So at least that is a good thing.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V9
Post by: lordpalandus on July 04, 2018, 12:04:10 AM
After months of fiddling with the code and experimenting with various approaches, I've finally eliminated the Double Window issue.

There are a few more things I wish to do for Alpha V10, and may release it early so that I can do a GOG submission during the week (as they appear to not count weekends as business days so I'd have to wait more than 5 business days for a response), and that also means a bug-free build will be available sooner for those that got hit by any one of the three runtime errors I discovered.

EDIT: I've accomplished all I want to for Alpha V10's submission to GOG. However, now I am going to thoroughly test out the code and make sure that I get rid of all of the obvious, easy to spot errors, typos, and bugs... and eliminate them. Once I've done so, I shall upload V10 here to OPU.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V10
Post by: lordpalandus on July 05, 2018, 06:06:48 PM
Released Alpha V10, and have started the submission process to GOG.

If you encountered any errors or bugs in Alpha V9, I'm pretty sure I fixed all of them. (I hope so at least; I did spend about 2 hours thoroughly testing and gameplay testing)
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V10
Post by: Hooman on July 10, 2018, 02:37:13 AM
You really push through on this stuff. It's impressive.



I don't suppose there is a way you can think of to get more feedback?
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V10
Post by: lordpalandus on July 10, 2018, 10:25:29 AM
There are a couple ways I had considered, just haven't looked into it trying it yet. If the GOG submission doesn't succeed, I'll look into trying Plan B.

So, you are probably wondering what is Plan B?

Plan B is try to do a Kickstarter or Indiegogo campaign (like Thomas Biskup did for his Ancient Domains of Mystery) and acquire funding to give the game a graphical and audible makeover. In order for that to succeed, I'll likely work towards completing the game to a much greater degree, and then post the game in a few places. Namely:

1. There is a subreddit dedicated to Roguelikes, where I noticed some people have placed their free-to-play games there, for users to try out and get feedback.

2. The libtcod library is hosted on RogueBasin, a site dedicated to roguelikes, particularly ones that use libtcod library (which I am). Might be a good place to get feedback on the game.

3. I could try to get it on Steam. The reason I haven't thus far attempted it, is because it is costly to do so, with no guarantee on return. As they have nuked their Greenlight system, (for good reason, yet screws me over) the only way you can get your first game onto their service now is to pay $5,000 + other fees (need to do various paperwork, have a business bank account, and have a legitimate company name which will cost somewhere in the range of $1,000 to $2,500). If you make $5,000, then they will give you back that money. It is basically their way of discouraging crappy developers as most won't be willing to pay 5k deposit fee to get their game up and thus the number of crappy games will decrease. However, for legitimate developers, who lack the 5k easily, this creates a major problem. If I had tons of money to burn, I could pay that cost... but, then again, if I had tons of money to burn, I probably wouldn't be trying to make a video game anyway, as video games are extremely risky endeavours. Catch 22 situation.   
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on July 14, 2018, 12:19:56 PM
Released Alpha V11. No word yet from GOG.

Added a major system, Profiles, which now allows progression across playthroughs. Otherwise, mostly a heavy refactoring and removing redundancy build.

Enjoy
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on July 18, 2018, 11:27:41 AM
I may be unable to post updates for a while.

My computer froze, and when I hard restarted it, it booted and then died about 30 seconds later with debug code 6F (MSI X99s Gaming 7 Mobo). Online it suggested to reset the cmos, and I did that. Now it boots to debug code 67 and stays there indefinitely. not sure how to proceed, but until I get it fixed, I won't be able to work on the code.

If anyone has a suggestion, please post it. Otherwise sorry for the inconvenience.

Edit:

1. After thinking about it for a few hours, I realized my nonbinary build has the main file uncompiled, so if I had to, I could install Python onto my older laptop and work on it. This wouldn't be desirable as I'd still lack access to all the other files, but if needed I have this as an option. If GoG doesn't accept the game then it probably wouldn't matter much to not post updates, while I get my main rig up and running.

2. I've had odd issues over the past several months that I attributed to my gpu, but now I think it was the cpu all along. I think the cpu has failed, which is why it gets stuck on a cpu related debug code. I think I'm still under warranty, so, could have it replaced but wouldn't have the computer until I'd get the part in saw 1-2 weeks. It might just need fresh thermal paste so will look into that first before doing anything else.

Edit2:

Nope, can't for whatever reason launch the uncompiled build. Installed python 2.7, installed three different VC_Redists and still will not launch. I can code it, but I can't run it and thus can't be sure if my changes are being successfully applied. Keeps spewing the error about not finding a file "api-ms-win-crt-runtime-l1-1-0.dll" is missing. And most sites online state that it is commonly a problem of a bad VC_Redist install. I installed three different versions, and hit repair as well for each, but nothing. So, looks like I am FUBAR. So, yeah. Sorry. NOTE: Laptop was bought in 2010, is 64 bit Windows 7 and downloaded three 64 bit vc_redist builds off of Microsoft directly.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: leeor_net on July 19, 2018, 09:18:48 AM
This is precisely the reason you should reconsider using source control. You can use GitLab if you want a private repository. But basically yeah, this I learned the hard way years ago when a hard drive crashed on me and I lost everything on it.
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on July 19, 2018, 02:34:23 PM
Live and learn. In the future I'll ensure that I have access to my uncompiled files at anytime.

Anyway, today is the two week mark for when I sent in my game submission. According to the automated response sent on July 5th, it says that due to an increased interest in their Indie program, if a game is not replied to within 2 business weeks, then it should be assumed that they have denied the game.

So... unless something changes in the next few days, I've been ghosted by GOG. So... while I lack access to the code, I'll take the time to plan out my next few steps. I think the game could be something great, but it is possible it got lost in the sea of titles trying to get GOG's attention. I'm sure this is likely caused by Steam closing down Greenlight. I haven't fully decided on how to proceed... but the three options currently available to me are:
1. Work towards Plan B.
2. Look into learning OpenGL and rebuild the renderer to use the GPU over the CPU. Likely require a huge code rebuild and/or abandoning the libtcod library altogether.
3. Abandon the title, and start working on my next title... either a Shmup or my aforementioned Outpost 2-like game I hinted at.

As I currently cannot test my code, (as windows/python refuses to compile the .py files on my laptop), I will be missing this week's release (unless my brother in-law, who is a computer technician by trade, can figure out what is wrong with the computer before Saturday/sunday)
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on July 19, 2018, 09:58:23 PM
Actually, quick question:

I noticed with my Alpha V10 build, released on July 5th, that there was a single download of the binary build. Anyone here download it?
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: Vagabond on July 20, 2018, 12:56:36 AM
Sorry to hear about your computer crash. How many days of development are you going to lose if you cannot access the hard drive?

I would encourage you to consider taking the game to completion over abandoning it to start a new title. Even if GOG doesn't take it, there would be a lot of good experience gained from the process. Nothing wrong with releasing it free of charge just to get your work out there if it doesn't seem marketable.

I downloaded it a while back and toyed with it some, but don't remember which version it was.

-Brett
Title: Re: Cataclysm of Chaos, Remade (ASCII) - Alpha V11
Post by: lordpalandus on July 20, 2018, 07:37:31 AM
Well, it depends on the problem. If the cpu somehow got unseated, it is likely an easy fix. if the cpu is completely borked, then dunno. I'm currently using this time to give my code a hard personal look and focus on designing or redesigning certain aspects of it.

For example the 26 item limit in the inventory is particularly frustrating. So I'm looking at designing a junk bag to store excess stuff while only the best stuff is in your inventory and still allows you to keep collecting loot, as scavenging useless items is a good source of runic shards.

I may not have considered it if I hadn't been forced to take a break from development. So I'm taking the time to think hard on various parts of the game and address them. So despite not been able to code, I'm still trying to at least work on design and implementation of the codebase at the present time.

Yes you are right. Completing something can be its own reward or a stepping stone to something else. Plus there is still things I feel I can learn from a Roguelike so, I'll work towards Plan B, whether it will be successful or not. Garnering an audience with a free title I supoo could be useful as well for when I do the next project... A group of potential testers if you will.

Well, the only version you posted any feedback on was BinaryV5, the first Binary build. Current Binary is V11.