• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 17:36
CET 23:36
KST 07:36
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !10Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win
Tourneys
$100 Prize Pool - Winter Warp Gate Masters Showdow $5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Anyone remember me from 2000s Bnet EAST server? soO on: FanTaSy's Potential Return to StarCraft Klaucher discontinued / in-game color settings
Tourneys
[Megathread] Daily Proleagues [BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1277 users

The Big Programming Thread - Page 163

Forum Index > General Forum
Post a Reply
Prev 1 161 162 163 164 165 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Sub40APM
Profile Joined August 2010
6336 Posts
September 04 2012 05:47 GMT
#3241
Ya so, wasypants has a good point. If you want to 'truly' understand you should start with a language that builds everything up from scratch. But do you have the willpower to grind through that? Because like he also said, with python you can be doing legitimately useful programs from almost day 1 and ya there will be an element of 'magic' to it in the sense that you wont actually know how what you ordered python to do worked under the hood...

I have known many more people who gave up on C and general programming than Python...
phar
Profile Joined August 2011
United States1080 Posts
September 04 2012 07:25 GMT
#3242
I would argue that to get someone interested in programming, you shouldn't hit them with a sledgehammer (C) to begin with. Attrition is going to be a lot lower if you start out actually making stuff, instead of spending 95% of your time fighting with gcc.

I would also argue that C is not a bottom-up approach. If you really want to understand wtf is going on, go like... E&M -> transistors -> architecture -> C. But, not everybody is going to want to learn the really low-level stuff. There are some people who find it fascinating (I am one of those people), but people think it's boring as ungodly fuck.

Also, most of the low level shit just does not matter for 99.9% of the software you do at a high level. Being able to modularize your code, use good designs, and make it readable so other people can mess with it is much more important (where "other people" == "you in 6 months", after you've completely forgotten wtf those 10k loc do).



All that said, if you continue programming, you really should learn C eventually because it's good for you :p
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 07:34 GMT
#3243
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
September 04 2012 07:54 GMT
#3244
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 08:43 GMT
#3245
On September 04 2012 16:54 Tobberoth wrote:
Show nested quote +
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".


Yeah so our "official" book is Head First Java (O'Reilly) and it's been recommended we check out the Gosling reference (since he created the language). I take it O'Reilly's text is a good book?

This stuff is a bit foreign to me as I didn't really use a text to learn Python and I used MIT's text to learn Scheme.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-09-05 04:05:40
September 05 2012 04:04 GMT
#3246
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Do you know C at all? If you know C, you already know many of the basic constraints in java, especially if you're talking about syntax. If you're any decent at the proper OO constructions in python, it won't be that hard to transition into java.

The official sun tutorials are pretty decent for a first start:

http://docs.oracle.com/javase/tutorial/

s/sun/oracle/


There's an excellent reference - Effective Java, but I'm not sure it's suitable for learning the basics. It's by Joshua Bloch, who wrote significant portions of the java language (the good parts too :p).

Yea reading through bits of it right now, doesn't seem like it'd be that useful for you. Start with a basic text or the official tutorials and see how it goes.


I also strongly suggest that you start off on the right foot and follow an actual style guide (pick one), even while you're first learning. It won't teach you anything about the language itself, but it will help other people be able to help you with your code when you inevitably have to ask for help (everyone does).

official one: http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html



Really though, just start hacking with it. Reading a book or guide isn't gonna go that far. Mess around, build shit, break stuff, ask for help.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 07:50 GMT
#3247
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.
Frigo
Profile Joined August 2009
Hungary1023 Posts
September 05 2012 09:24 GMT
#3248
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.
http://www.fimfiction.net/user/Treasure_Chest
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 15:43 GMT
#3249
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:49:37
September 05 2012 23:38 GMT
#3250
Has anyone here implemented an Octree into a raytracer/pathtracer or something similar? I'm getting somewhat frustrated T_T

edit: as usual, you try to find the answer on your own for hours and get nothing. then you post your question and find the answer on your own 5 minutes later. ^_^
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
Last Edited: 2012-09-06 00:05:16
September 06 2012 00:01 GMT
#3251
Hello TL Programmers

A few weeks ago I decided that I wanted to learn and master HTML/CSS/Javascript and SQL.

To solidify my learnings as I went forward, I started a web based game project.

My project is Knights of Drakon, a top down oldschool RPG written entirely in JavaScript/html/css.
Link to my game

The reason I come here is to ask for some advice from seasoned programmers regarding certain game parts.

Im gonna just ask my questions and hope someone will answer

1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap

2. Same as above for a dodge system.

3. Whats the best way to code a turn based 1v1 combat versus a monster. Player attacks, then the monster attacks, so on so forth, untill one is dead. I know this one is a broad scope question, But ANY idea and input is greatly appreciated




Furthermore and possibly off topic, I have my hands full and would appreciate people partnering up with me and contributing to the site, Id love experienced people in all backgrounds, Arists, Coders, Webmaster, Gamedesigners, Level Designers, and someone to help me set up forums for the project, email me from the site or PM here

Thanks TL

"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:28:08
September 06 2012 00:27 GMT
#3252
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.


DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 00:46 GMT
#3253
On September 06 2012 09:27 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?
"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:53 GMT
#3254
On September 06 2012 09:46 DarkGeneral wrote:
Show nested quote +
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn
Brutland
Profile Joined February 2011
United States92 Posts
Last Edited: 2012-09-06 00:57:05
September 06 2012 00:54 GMT
#3255
dmgMod= LvlMod*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod

LvlMod= abs(charLvl-oppLvl)*whatever percent or modifying fn here
"I drank What?"
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:57 GMT
#3256
On September 06 2012 09:54 Brutland wrote:
dmgMod= abs((oppLvl-charLvl))*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod


this would result in getting the same modifiers for lvl4 vs lvl6 / lvl 6 vs lvl 4
Craton
Profile Blog Joined December 2009
United States17274 Posts
September 06 2012 01:09 GMT
#3257
On September 05 2012 16:50 wherebugsgo wrote:
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.

It feels weird as hell not to when you started the other way.
twitch.tv/cratonz
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 01:10 GMT
#3258
On September 06 2012 09:53 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:46 DarkGeneral wrote:
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn


Beautiful simplcity,

now for the last aspect, how would I implement diminishing returns?

As the number increases and the % approaches lets say 70% the % amount per armor point would have to curve down, what is the best way to do that?
"Everybody gotta die some time, righ'?" - Wraith Pilot
phar
Profile Joined August 2011
United States1080 Posts
September 06 2012 04:16 GMT
#3259
On September 06 2012 00:43 wherebugsgo wrote:
Show nested quote +
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 06 2012 05:46 GMT
#3260
On September 06 2012 13:16 phar wrote:
Show nested quote +
On September 06 2012 00:43 wherebugsgo wrote:
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.


yeah so it's for a university class (UC Berkeley) and our "official" text editor is emacs. We have been told that we can use Eclipse if we want to, but our prof made a list of things he hates about Eclipse and most of us learned on vim/emacs anyway so it's not a huge deal.

Prev 1 161 162 163 164 165 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 13h 24m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft413
IndyStarCraft 283
JuggernautJason114
elazer 4
StarCraft: Brood War
EffOrt 123
910 36
Dota 2
febbydoto15
Super Smash Bros
hungrybox270
Other Games
Grubby4258
FrodaN2136
Beastyqt710
B2W.Neo614
RotterdaM219
mouzStarbuck195
Liquid`Hasu184
C9.Mang0180
XaKoH 101
Mew2King66
tarik_tv65
Maynarde48
ViBE10
shahzam1
Organizations
Other Games
BasetradeTV54
StarCraft 2
angryscii 35
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• RyuSc2 42
• Reevou 14
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• sooper7s
• Migwel
StarCraft: Brood War
• mYiSmile138
• Michael_bg 8
• XenOsky 1
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21246
Other Games
• imaqtpie1953
• Shiphtur524
Upcoming Events
WardiTV Invitational
13h 24m
Gerald vs YoungYakov
Spirit vs MaNa
SHIN vs Percival
Creator vs Scarlett
Replay Cast
1d 10h
WardiTV Invitational
1d 13h
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
3 days
Sparkling Tuna Cup
4 days
Krystianer vs TBD
TriGGeR vs SKillous
Percival vs TBD
ByuN vs Nicoract
Replay Cast
5 days
Wardi Open
5 days
Liquipedia Results

Completed

Proleague 2025-12-22
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.