• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:51
CEST 14:51
KST 21:51
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL62Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event21Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays FEL Cracov 2025 (July 27) - $8000 live event Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Player “Jedi” cheat on CSL SC uni coach streams logging into betting site Flash Announces Hiatus From ASL Practice Partners (Official) ASL20 Preliminary Maps
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Summer Games Done Quick 2025! Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 624 users

The Big Programming Thread - Page 709

Forum Index > General Forum
Post a Reply
Prev 1 707 708 709 710 711 1031 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.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
March 11 2016 18:25 GMT
#14161
On March 12 2016 03:17 madnessman wrote:
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.


You could always check out the WC3 AI. It comes bundled with the standard game in the editor. Me and my brother did have a blast editing AI's and pitting them against each other in it. Never got around to checking if you could mess with the internals of it, but it could be worth a try.
Time is precious. Waste it wisely.
madnessman
Profile Blog Joined May 2009
United States1581 Posts
March 11 2016 18:40 GMT
#14162
On March 12 2016 03:25 Manit0u wrote:
Show nested quote +
On March 12 2016 03:17 madnessman wrote:
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.


You could always check out the WC3 AI. It comes bundled with the standard game in the editor. Me and my brother did have a blast editing AI's and pitting them against each other in it. Never got around to checking if you could mess with the internals of it, but it could be worth a try.


There's actually a great FOSS API for interfacing with BW (https://github.com/bwapi/bwapi) which seems to be the standard. Time to brush off the C++ skills!
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
March 11 2016 20:31 GMT
#14163
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.

Nah, not that, it's that since php supports heterogeneous arrays you would think an index call to a 1-d array element would not be allowed. Not sure how PHP is implemented but it probably increases overhead having to check to make sure the array element is indexable / that there isn't a runtime error. And yeah as others said it's borderline obfuscatory.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
March 11 2016 21:31 GMT
#14164
C++14 question.

Why do people use auto parameters and auto return type? How is this safe if you change a function in the future?
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
Last Edited: 2016-03-11 21:44:33
March 11 2016 21:36 GMT
#14165

$str = 'abcd';

if (is_array($str)) {
echo 'array';
} else {
echo 'not an array';
} // not an array

echo $str[3]; // d

echo implode(', ', array_values($str)); // ERROR: array_values() expects parameter 1 to be array, string given


[image loading]

It would seem that strings in PHP are treated like char arrays only when you're trying to access index on them (also used for functions like strpos etc.) but otherwise they're just string literals? It's bullshit if you ask me.

On March 12 2016 06:31 Shield wrote:
C++14 question.

Why do people use auto parameters and auto return type? How is this safe if you change a function in the future?


I guess it's because g++ is a really good compiler and it'll fill those out with proper types anyway? I'm not a C++ specialist by any measure so you'll want a second opinion on this.
Time is precious. Waste it wisely.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-03-11 22:54:01
March 11 2016 22:53 GMT
#14166
On March 12 2016 06:36 Manit0u wrote:

$str = 'abcd';

if (is_array($str)) {
echo 'array';
} else {
echo 'not an array';
} // not an array

echo $str[3]; // d

echo implode(', ', array_values($str)); // ERROR: array_values() expects parameter 1 to be array, string given


[image loading]

It would seem that strings in PHP are treated like char arrays only when you're trying to access index on them (also used for functions like strpos etc.) but otherwise they're just string literals? It's bullshit if you ask me.

Show nested quote +
On March 12 2016 06:31 Shield wrote:
C++14 question.

Why do people use auto parameters and auto return type? How is this safe if you change a function in the future?


I guess it's because g++ is a really good compiler and it'll fill those out with proper types anyway? I'm not a C++ specialist by any measure so you'll want a second opinion on this.


C++11 and C++14 have auto defined by standard, so g++ is irrelevant here. Any C++14 compiler is supposed to support this.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
March 11 2016 23:47 GMT
#14167
Yeah, but is it a matter of "Do not help the compiler" (as in - no need to use static typing since the compiler can optimize it nicely for you so you can just go ahead and declare stuff as auto without any loss to performance) or something else entirely?
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain17971 Posts
March 12 2016 00:18 GMT
#14168
On March 12 2016 03:17 madnessman wrote:
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.

In general, in games, it´s really hard to beat a selection of hardcoded strategies.

Think of chess: sure, you can choose your flavour of opening, but once you choose the opening, you just follow it through for 5-10 moves before things deviate again. In SC:BW this is your build order. Then you get to the hard part of chess, or in SC:BW, you get to the bit where you have to decide based on how the game is developing what to do: army composition, etc. etc. Skirmishes are like chess endgame: there are once again a set of preset moves which work (muta stacking, focus firing, spreading out in an arc, stutter stepping, etc. etc.)

Obviously there are things that are different from chess (pretty much all the decisionmaking is based on incomplete information for starters, and the search space is both far larger and far smaller at the same time).

Anyway, it's a fun project, so go for it! As others mentioned, can do it for WC3 too, which might be more interesting (less figured out because there's so many spells).
Cyx.
Profile Joined November 2010
Canada806 Posts
Last Edited: 2016-03-12 05:49:12
March 12 2016 05:38 GMT
#14169
On March 12 2016 08:47 Manit0u wrote:
Yeah, but is it a matter of "Do not help the compiler" (as in - no need to use static typing since the compiler can optimize it nicely for you so you can just go ahead and declare stuff as auto without any loss to performance) or something else entirely?

I usually refer people to Herb Sutter when talking about auto. The main argument of the linked article is that it abstracts the actual types from your code and makes it dependent only on the interface, which I completely agree with. The thing I think he trivializes a bit is that sometimes it makes your code distinctly less readable when the types become unclear - I tend to use auto everywhere, unless I feel like it would impact readability, for those reasons.

e: maybe an example would be cool.


list<Thing> things = GetThings();

for (const Thing &thing : things) {
thing.DoStuff();
}


auto things = GetThings();

for (const auto &thing : things) {
thing.DoStuff();
}

There are two ways using auto makes this nicer if the return type of GetThings() changes.

1) GetThings() changes to return a vector<Thing> instead of a list<Thing> (because someone you work with heard it was Good Practice (tm) to use vectors and not lists). The explicitly typed code has to be changed to state that things is a vector<thing>.

2) GetThings() changes to return a list<IThing> instead of a list<Thing> (because someone you work with heard it was Good Practice (tm) to use interfaces and not concrete classes). The explicitly typed code has to be changed to state that things is a list<IThing>, and thing is an IThing, while the auto code only relies on the DoStuff() method being present.
raNazUra
Profile Joined December 2012
United States10 Posts
March 12 2016 06:18 GMT
#14170
On March 12 2016 03:17 madnessman wrote:
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.


If you're starting from scratch, you may want to check out UAlbertaBot. It's pretty modular and easy to improve, and has most of the basic software engineering done, things that can be annoying to deal with.

Or you can start completely fresh! As an AI researcher who uses SC:BW on occasion, we'd love to have more people to play against =) As you said, for now good engineering (i.e. limiting manipulatable edge cases) is almost more important than having a sophisticated AI, but hopefully we'll get past that.
Speak the truth, even if your voice shakes
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
March 12 2016 07:50 GMT
#14171
On March 12 2016 15:18 raNazUra wrote:
Show nested quote +
On March 12 2016 03:17 madnessman wrote:
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.


If you're starting from scratch, you may want to check out UAlbertaBot. It's pretty modular and easy to improve, and has most of the basic software engineering done, things that can be annoying to deal with.

Or you can start completely fresh! As an AI researcher who uses SC:BW on occasion, we'd love to have more people to play against =) As you said, for now good engineering (i.e. limiting manipulatable edge cases) is almost more important than having a sophisticated AI, but hopefully we'll get past that.

Thanks for posting this, I'm taking my first AI class next fall and reading through some of the UAlberta code got me super excited
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-03-15 14:56:46
March 15 2016 14:54 GMT
#14172
Hey guys, my final year design project was a WebGL debugger embedded inside Chrome DevTools.

GitHub repo

Chrome Web Store

If it's not too much trouble, could you guys star the GitHub repo (we can get marks based on stars lol) and if you're super interested in WebGL things, give it an install and a test run? It'd be really helpful.

:D

Also our code isn't super amazing since only one of us is true JS dev, but we think it ended up pretty well.
There is no one like you in the universe.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 16 2016 13:46 GMT
#14173
[image loading]

F**k Zend Framework 2. There is a bug in the code, guess where it is?
No, it's not anywhere in that stacktrace, it's in a controller that doesn't even appear in the stack trace, because of ZF2's stupid event system that detaches itself from the actual code.
If I didn't know what code I touched, I'd be stuck searching the problem for half an hour trying to find the problem.

Don't use ZF2 for your projects.
tofucake
Profile Blog Joined October 2009
Hyrule19030 Posts
March 16 2016 13:53 GMT
#14174
I tried ZF2 a while back and hated it. Laravel and Symfony are sooooo much better, imo
Liquipediaasante sana squash banana
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 16 2016 13:57 GMT
#14175
On March 16 2016 22:53 tofucake wrote:
I tried ZF2 a while back and hated it. Laravel and Symfony are sooooo much better, imo


Pretty much anything is better. We're still stuck with ZF2, because our dutch overlords used it for the online shop and so we had to use it for our new website as well. Now they are pretty much out of the decision making progress, but we have too much code to scrap it and use something proper.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
March 16 2016 20:54 GMT
#14176
Heh, I'm just negotiating a new contract with the company that wants to turn all of their old ZF1 code into Spring. Might be quite an adventure.
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain17971 Posts
March 16 2016 21:13 GMT
#14177
On March 16 2016 22:46 Morfildur wrote:
[image loading]

F**k Zend Framework 2. There is a bug in the code, guess where it is?
No, it's not anywhere in that stacktrace, it's in a controller that doesn't even appear in the stack trace, because of ZF2's stupid event system that detaches itself from the actual code.
If I didn't know what code I touched, I'd be stuck searching the problem for half an hour trying to find the problem.

Don't use ZF2 for your projects.

All I saw was that your stacktrace starts with pleasure_xxx.php.

Not even hiding that you`re building a porn website?
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 16 2016 23:17 GMT
#14178
On March 17 2016 06:13 Acrofales wrote:
Show nested quote +
On March 16 2016 22:46 Morfildur wrote:
[image loading]

F**k Zend Framework 2. There is a bug in the code, guess where it is?
No, it's not anywhere in that stacktrace, it's in a controller that doesn't even appear in the stack trace, because of ZF2's stupid event system that detaches itself from the actual code.
If I didn't know what code I touched, I'd be stuck searching the problem for half an hour trying to find the problem.

Don't use ZF2 for your projects.

All I saw was that your stacktrace starts with pleasure_xxx.php.

Not even hiding that you`re building a porn website?

It's my job. It pays. And it's not half as fun as you imagine.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
Last Edited: 2016-03-16 23:45:39
March 16 2016 23:42 GMT
#14179
At least we know it's not pornhub (it runs on Symfony)

And Morfildur is right, it's just a job. You'd be surprised how soon you get fed up with stuff like that when working on erotic lingerie websites etc. After a while it doesn't really matter what you're displaying, dumb scientology books, gay porn, whatever, you simply stop noticing it.
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-03-17 14:37:12
March 17 2016 05:50 GMT
#14180
--- Nuked ---
Prev 1 707 708 709 710 711 1031 Next
Please log in or register to reply.
Live Events Refresh
WardiTV European League
12:00
Swiss Groups Day 2
WardiTV837
TKL 431
Liquipedia
FEL
12:00
Cracov 2025: Qualifier #2
IndyStarCraft 292
CranKy Ducklings79
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 431
IndyStarCraft 292
Rex 112
MindelVK 39
StarCraft: Brood War
Sea 10640
Calm 9426
Rain 7250
Bisu 2830
Horang2 2319
Hyuk 1379
Jaedong 1252
Shuttle 501
Rush 493
EffOrt 296
[ Show more ]
Stork 282
Leta 270
Last 241
Mini 216
PianO 215
ToSsGirL 163
Hyun 135
ZerO 84
Movie 62
hero 49
TY 49
JYJ42
Killer 35
JulyZerg 26
ajuk12(nOOB) 22
HiyA 20
Free 20
zelot 20
GoRush 19
Sacsri 17
Barracks 16
Terrorterran 6
ivOry 3
Icarus 3
Stormgate
NightEnD21
Dota 2
qojqva3057
XcaliburYe452
canceldota102
League of Legends
singsing2958
Counter-Strike
x6flipin739
zeus440
Heroes of the Storm
Khaldor315
Other Games
Gorgc2854
B2W.Neo1375
DeMusliM540
Happy390
Fuzer 389
crisheroes369
Pyrionflax337
XaKoH 258
Hui .243
RotterdaM147
ArmadaUGS70
KnowMe60
ZerO(Twitch)17
Organizations
StarCraft: Brood War
CasterMuse 21
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 38
• iHatsuTV 6
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV749
• Ler42
Upcoming Events
BSL: ProLeague
5h 9m
Dewalt vs Bonyth
Replay Cast
1d 11h
Sparkling Tuna Cup
1d 21h
WardiTV European League
2 days
The PondCast
2 days
Replay Cast
3 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
4 days
RSL Revival
4 days
Classic vs Cure
FEL
5 days
[ Show More ]
RSL Revival
5 days
FEL
5 days
FEL
6 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.