C
C#2y ago
fateos

❔ Learning C#

Hello Guys, I have been doing a lot of theory lately (WinForms) to see whats possible and see the basics. Now I wanna practise with little programs. I have already done Numberguessing and Connect4 both of them were really fun to program. What else would you recommend programming? Which database is preferable if I want to program something with it SQLite or MS Access? I also see lots of people recommending just to code but as long as you don´t get feedback for it is it really gonna get u to get better as a programmer? Don´t wanna get into bad habits and want to learn coding properly. Any help appreciated
63 Replies
Cattywampus
Cattywampus2y ago
did those people also recommend not to use winforms? 😃 but it should be fine still if you're planning to just learn the language
fateos
fateosOP2y ago
I will start to work on Tuesday and there we use Xamarin(mobile) for client WinForms and WPF so I kind have to learn all 33
Cattywampus
Cattywampus2y ago
regarding database question, nobody really uses ms acccess, sqlite is fine
Connor
Connor2y ago
DONT LEARN WINFORMS OR WPF My only advice Waste of time
Cattywampus
Cattywampus2y ago
wpf is fine
fateos
fateosOP2y ago
The problem I had with numberguessing and Connect4 is that I did it in console without really applying oop
Connor
Connor2y ago
It’s inferior to all the other alternatives
fateos
fateosOP2y ago
so I am looking for a bigger "game" project that applies interfaces composition oop
Cattywampus
Cattywampus2y ago
pls elaborate
fateos
fateosOP2y ago
The book I am following rn has Tetris in there so I will do that one next
Cattywampus
Cattywampus2y ago
yeah that's a nice to start with... or perhaps just a console game
fateos
fateosOP2y ago
I have done 2 console games already actually 3 if we count wordle
fateos
fateosOP2y ago
this is what I found aswell but its a bit bigger so I will do it after tetris any content similar to this that teaches u side by side how to do a bigger project?
Cattywampus
Cattywampus2y ago
thats cool, I wish I had the time to make my own console game 😭
fateos
fateosOP2y ago
I struggle with class design not even with the actual programming
Cattywampus
Cattywampus2y ago
you mean inheritance?
fateos
fateosOP2y ago
no I went through all the principles kind of I knkow what they are
Connor
Connor2y ago
WPF is not cross platform, it has a smaller ecosystem, it is losing support from Microsoft, has shit syntax and conventions, low performance. Blazor, maui, uno, etc are the modern solutions you should be using. They are easier to use, more robust, and are the target of Microsoft’s future.
fateos
fateosOP2y ago
its just that lets say I wanna program a little RPG like this without any help I would struggle to build it because I wouldnt know how to plan the classes interfaces inheritance composition together so its not the actual logic programming that I struggle in first place
fateos
fateosOP2y ago
ngl this game looks super cool to program:
fateos
fateosOP2y ago
I just thought maybe there are better smaller ideas first before I get into this but if its too small like wordle or numberguessing or even connect4 where I dont really need class design per se Its not very interesting for me to program rn
Laxman
Laxman2y ago
Just Look up how basic infrastructure in games is, like gamoloop threads etc, or ask chatgpt ;)
fateos
fateosOP2y ago
I wish there was a site with lots of good design examples to learn from with explanations
Cattywampus
Cattywampus2y ago
tons of them you can find on the internet really, you just need to find the correct keyword for them
fateos
fateosOP2y ago
I have seen a few bad ones so its hard to judge if thats the right way
Cattywampus
Cattywampus2y ago
if you just want to learn the concept of rpg game, then there are tons of them on youtube even
fateos
fateosOP2y ago
not just rpg game just general after all I wont be programming rpgs at my work rpg is just an example because this is the only project I found that teaches u how to program something like this with explanation and because its fun
Cattywampus
Cattywampus2y ago
also there are tons of aspects in rpg game.. inventories, character/enemy stats, item stats etc... most important is the dialog system that you're going to use in-game
fateos
fateosOP2y ago
ye for rpg I found that project so I am good with that one I think lookking for similar projects I just found this https://www.thecsharpacademy.com/project/12 it has a few projects but there seems to be no solution
Cattywampus
Cattywampus2y ago
and you should make your own tooling for that in a sense that you don't need need to code each item stats, character stats and hard coding your characters dialog in your code
fateos
fateosOP2y ago
or like kind of "best practise" to code those projects
Cattywampus
Cattywampus2y ago
I just sorta mentioned it before your post so everything in your game can be dynamically added, updated, adjusted etc of course they don't need to be a full blown game editor, just a simple helper tools to help you manage your inventories, char stats etc while making your game
fateos
fateosOP2y ago
oh you mean instead of programming everything urself? isnt that more towards game engine then? for me its not about getting a good game out its about the programming experience
Cattywampus
Cattywampus2y ago
nope, you're making your own tools to make your life easier when developing games. This is a common practice
fateos
fateosOP2y ago
oh well then thats what I already plan to do
fateos
fateosOP2y ago
fateos
fateosOP2y ago
can u see the classes? this is how far I got with my design
Cattywampus
Cattywampus2y ago
ah yes, then you should think of your stats for example
class SomeCharacter : BaseClass, ICommonStats, IUniqueStats
{}
class SomeCharacter : BaseClass, ICommonStats, IUniqueStats
{}
where commmon stats can be hp, mp, def mp.def etc
fateos
fateosOP2y ago
the problem I have rn is appearently I shouldnt make a new class for each different axe for example
Cattywampus
Cattywampus2y ago
and where uniquestats can be your enemy/character specific stats
fateos
fateosOP2y ago
and each different axe is just a new object from the axe class but a new item itself I thought maybe doing it with the rarity pattern so a common axe , rare axe, legendary axe all just objects of the class axe and the class axe itself adds additional stats on to that weapon depending on what rarity I created the item so in the constructor i suppose and uniquestats being?
MODiX
MODiX2y ago
SlimStv#2835
and where uniquestats can be your enemy/character specific stats
Quoted by
<@!726512159940411422> from #Learning C# (click here)
React with ❌ to remove this embed.
fateos
fateosOP2y ago
yes but specific example?
Cattywampus
Cattywampus2y ago
like related to it's type for example like fire, water etc
fateos
fateosOP2y ago
everyone would have that no? u mean like fire resistance as stats for example?
Cattywampus
Cattywampus2y ago
do you want them to have all on each enemy/character? if so then sure also if the character is a magic user then they should have a different property than any other non-magic characters in the game
fateos
fateosOP2y ago
ye that would be way too advanced for now just get the core game design down what do u think of the different weapons the way i described it? also would u use different classes for each different armor piece? I kind of think of a base armor platebody class and use decorate design pattern to makke it a gold platebody forexample
Cattywampus
Cattywampus2y ago
same thing.. you can do
class SomeWeapon : BaseWeaponClass, IPhysical //OR// IMagical{}
class SomeWeapon : BaseWeaponClass, IPhysical //OR// IMagical{}
fateos
fateosOP2y ago
ye but each different weapon a different class?
Cattywampus
Cattywampus2y ago
you don't need to, no.. see the baseclass there? you can set for your base weapon property there such as weapon name, description, etc and the interfaces will do the rest (whether it's physical or magical weapon)
fateos
fateosOP2y ago
u see my class diagram? so thats bullshiet what I did there?
Cattywampus
Cattywampus2y ago
yes
fateos
fateosOP2y ago
thats just for base axe class I wanted to get different kind of axes aswell
Cattywampus
Cattywampus2y ago
yes 😃 and the above was explaining about that
fateos
fateosOP2y ago
for example I needed 2H swords (so I cant equip a shield with it) and normal swords but I guess this behaviour I can solve it with I2HWeapon oh wait I cant the problem with that design above is if I use the same class for an axe and same for a sword I cant have different type of attacks based off of the type of weapon
Cattywampus
Cattywampus2y ago
you can make your Axe as a separate class it's up to you so your Axe class can as well implement IPhysical too or if the Axe class had a magic property you can also implement both IPhysical and IMagical to it the impl here is up to you as the creator
fateos
fateosOP2y ago
but each type of an axe shouldnt have its own class like my problem to understand is its like I have a car class for all cars (Weapon) for me now we can have audi ford, fiat whatever right those should be all different classes in my case it could be axe,dagger,sword, 2hSword and so on now lets say audi has a very old car with less functionality and a new audi comes out with more functionality shouldnt that come from the IaudiFunctionality the old ones would have nothing implemented and for the new ones the new functions would apply this is where I struggle in oop design like how to manage this
Cattywampus
Cattywampus2y ago
that's correct, thus we have two interfaces there.. and if the Axe does have a unique property that's not in both IPhysical or IMagical then you can make a another base class specifically for the Axe class and use that instead.. tbh BaseWeaponClass + IPhysical/IMagical should be enough but it depends on how you wanted it I guess you should see draksouls for example, the property for the Axes there are the same with the sword the only difference is that they're much heavier
fateos
fateosOP2y ago
cant we do a property in the Iphysical interface for IsTwoHanded bool type?
Cattywampus
Cattywampus2y ago
sure
fateos
fateosOP2y ago
and when I create the axxe object I can just give that object the parameter to initialize I guess I can just try to do it with the minimalist approach as u said and if I realize I need more I can still exxtend it with more classes and just copy paste code I guess I should just start eventually and see when I run into problems design wise and not try to overthink as I do rn
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server