Announcement

Collapse
No announcement yet.

What's Going On

Collapse

There are currently 18 users online. 0 members and 18 guests.

Most users ever online was 1,083 at 04:38 AM on 2016-11-18.

Design Philsophies and shit.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Design Philsophies and shit.

    Been struggling with my text based adventure game engine of the last month. I have re-written the code base like 4 times now and it's like ARGH! I'm not doing this so much to make a game, but to try put good design practices in place. So that I end up with reusable, open close etc code, but I always seem to struggle with the design phase.

    Constantly I am going back and forth to paper and writing my ideas, planning, etc down and then coding up something and hit a wall.

    A lot of what I am trying can get a bit overwhelming for a novice and I am trying to make it all interfaces instead of implemented, but god damn can it get confusing thinking about all of it at such an abstract level.

    My old way was to start throwing code down 'till I hit a problem and then stop and think, but for this I want to do it differently (tried that approach and I quickly hit a dead end) I am also reading some stuff on OOAD, but it's a bit boring. I will keep at it though,

    My question is, what is some of your design philosophies if you have any?

  • #2

    Apart from stating the obvious loosely coupled and highly cohesive I have always struggled with the same thing as you've stated about writing something and then realising that you can do it all so much better.
    The mentality I have applied to my AttemptX project(that I'm still working on btw) is that it's not about initially creating an elaborate impressive engine, but instead, just getting the damn thing working.

    This means just implementing the bare bones. Yes it's tempting to go back and create high end tools or bells and whistles of all sorts, but no... that's not your goal here, instead your focus should be on getting all the modules talking and completing the pipe line.

    Also about trying to create abstract frameworks. I often find it's A LOT easier to start specific(i.e. no interfaces) and then as the design progresses, you can start to abstract various modules as you realise the benefit of having certain modules being able to be swapped out noting that some times it might not always be the best move to implement the overhead to create an abstract framework if you're only ever going to use the one implementation. Note that this same approach applies for trying to make your code reusable. For example it's a lot easier to wait until you realise the same bit of functionality is required somewhere else then refactor the appropriate code into a utility class than it is to try and predict the future then run into the problem of your code driving the design instead of your design driving the code.
    Last edited by tricxta; 2017-06-07, 11:03 AM.
    Codr and Chicken like this.


    Comment

    • #3

      I do the fail faster method. I will do all the wrong things as fast as i can as hard as i can. Then i am eventually left with one glorious semi decent thing.

      This method will get you good results in minutes.

      Sent from my SM-N920R7 using Tapatalk

      Chicken likes this.

      Comment

      • #4

        On Oil Factory, and even more when I've worked on my editor, I tried to dissect every component my game needed and building them progressively. Starting by what I will notice when testing. (display and image first, then movements etc... I would not develop movements before displaying an image because that's code I couldn't test for the moment).

        On older projects, I wasn't as good at dissecting but the philosophy of starting with what I can test when running the code was already there.

        Here's a text based adventure I've programmed using python and pygame. The first complete thing I've ever made.
        https://pastebin.com/2XMe0D0w



        I like this image:
        image_4051.png
        Last edited by 2ndwolf; 2017-06-09, 12:37 AM.

        Comment

        • #5

          I personally wonder how you could have gone so often rewriting the whole thing so I do not have a philosophy or experience that could help.
          Maybe if I kept programming my editor I would also have hit a wall like you did.

          Comment

          • #6

            I wouldn't really call it a wall. As I could easily have continued with all the ones I wrote, but it wouldn't be good code. And the reason I was doing it was to produce good code similar to how tricxta put it loosely coupled and such. With each iteration I have been learning new things and have been able to reuse certain things (or can reuse them)

            I mainly hit a point where in the design I see flaws when moving a head with it and think to myself I can continue or just re-write it and I don't actually mind rewriting the code over and over lol.

            Comment

            • #7

              dont let perfection get in the way of progress dude
              2ndwolf and Chicken like this.

              Comment

              • #8

                Originally posted by hosler View Post
                dont let perfection get in the way of progress dude
                This is so much easier said than done.

                Comment

                • #9

                  yeah but only for scrubs

                  Comment

                  • #10

                    Ouch. lol.

                    Thanks for all the input, ideas etc. I think I will try things a bit less abstract and simpler as suggested by tricxta and 2ndwolf. Technically I already have done it, but as I was refactoring my classes I decided to update and my eclipse shat itself as it couldn't find the JRE easy fix, but had to go work out before I could test the damn thing.

                    Another stupid thing I did was when I was editing the entity class I was actually editing the wrong one (had one open from when I was messing with the decorator pattern for practice. Decided I would use it to extend a basic text based entities description, for the test) I was wondering why the imports were messing up and nothing was working correctly XD *looked to the left* "Oh, wrong project folder.."

                    Comment

                    • #11

                      Originally posted by Codr View Post
                      This is so much easier said than done.
                      I think it's simply boils down to a matter of self discipline i.e. keeping the reigns on yourself and making sure you don't go overboard. For some people this might prove difficult but maybe that's a sign of immaturity?

                      Originally posted by Chicken View Post
                      Ouch. lol.

                      Thanks for all the input, ideas etc. I think I will try things a bit less abstract and simpler as suggested by tricxta and 2ndwolf. Technically I already have done it, but as I was refactoring my classes I decided to update and my eclipse shat itself as it couldn't find the JRE easy fix, but had to go work out before I could test the damn thing.

                      Another stupid thing I did was when I was editing the entity class I was actually editing the wrong one (had one open from when I was messing with the decorator pattern for practice. Decided I would use it to extend a basic text based entities description, for the test) I was wondering why the imports were messing up and nothing was working correctly XD *looked to the left* "Oh, wrong project folder.."
                      When do we get screenshots? :o


                      Comment

                      • #12

                        Originally posted by tricxta View Post
                        I think it simply boils down to a matter of self discipline i.e. keeping the reins on yourself and making sure you don't go overboard. For some people this might prove difficult but maybe that's a sign of immaturity?
                        Not a sign of immaturity. Codr is certainly more mature than I am at programming and I have no difficulty leaving suboptimal code that works as is.
                        As I said, I make things work and build upon it, no biggie.

                        Comment

                        • #13

                          I will provide some screenshots, animated gifs when there's actually something to show XD I do have the old code, but it's all test. And that's just me taking hardcoded commands and outputting through console, rather then an interface. Those are the easy parts to do, the hard part is the middle and how all the objects, rooms, etc work together that I am struggling with.

                          As I said this is more of a exercise rather than making a game. As I want to keep building on my core fundamentals. So, it could be some time before there is anything worthwhile to show.

                          Comment

                          • #14

                            Originally posted by 2ndwolf View Post

                            Not a sign of immaturity. Codr is certainly more mature than I am at programming and I have no difficulty leaving suboptimal code that works as is.
                            As I said, I make things work and build upon it, no biggie.
                            I said "for some people" inferring not all. Perhaps it's not part of your personality to strive for perfection


                            Comment

                            • #15

                              I cannot say I strive for perfection but am very demanding towards myself in everyday life.

                              An immature programmer can certainly push himself to rewrite code a lot but I do not believe it's linked.
                              I'm just answering the question.
                              I see no link.
                              Cannot come up with a good example, sorry about that.

                              Comment

                              Working...
                              X