Author Topic: Cataclysm of Chaos, Remade (ASCII) - Alpha V11  (Read 3864 times)

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Cataclysm of Chaos, Remade (ASCII) - Alpha V11
« 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
« Last Edit: July 15, 2018, 07:40:39 AM by lordpalandus »
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Cataclysm of Chaos, Remade (ASCII), Alpha V11
« Reply #1 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!
« Last Edit: July 15, 2018, 07:57:17 AM by lordpalandus »
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison
« Reply #2 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.

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison
« Reply #3 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 681
Re: Chaotic Planar Prison
« Reply #4 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

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison
« Reply #5 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.
« Last Edit: March 17, 2018, 11:14:05 AM by lordpalandus »
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V2
« Reply #6 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V2
« Reply #7 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.


Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V2
« Reply #8 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V2
« Reply #9 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
Bitbucket




On a related note, here's some food for thought:
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.
« Last Edit: March 20, 2018, 01:26:55 AM by Hooman »

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 1856
    • LairWorks Entertainment
Re: Chaotic Planar Prison - Prototype V2
« Reply #10 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.
- Leeor
LairWorks Entertainment

Titanum UFO's

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V2
« Reply #11 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 681
Re: Chaotic Planar Prison - Prototype V2
« Reply #12 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

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V2
« Reply #13 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.

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V2
« Reply #14 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).
« Last Edit: March 25, 2018, 12:27:59 PM by lordpalandus »
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V3
« Reply #15 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V3
« Reply #16 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 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?

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.

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V3
« Reply #17 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
« Last Edit: March 28, 2018, 09:02:02 PM by leeor_net »
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 1856
    • LairWorks Entertainment
Re: Chaotic Planar Prison - Prototype V3
« Reply #18 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.
« Last Edit: March 28, 2018, 09:18:13 PM by leeor_net »
- Leeor
LairWorks Entertainment

Titanum UFO's

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V3
« Reply #19 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.
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V3
« Reply #20 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, including a more complete list of Truthy/Falsy values.

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V3
« Reply #21 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!
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V4
« Reply #22 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!
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
Re: Chaotic Planar Prison - Prototype V4
« Reply #23 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 if you want to check the docs.

There's also some info on StackOverfow about Trimming 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

Offline lordpalandus

  • Hero Member
  • *****
  • Posts: 627
Re: Chaotic Planar Prison - Prototype V4
« Reply #24 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?
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html